diff --git a/module/VuFindSearch/src/VuFindSearch/Backend/Exception/BackendException.php b/module/VuFindSearch/src/VuFindSearch/Backend/Exception/BackendException.php index 6dd07a8ed3f1507bd28198ac33724a32f9c8a4f4..51e4db49755dad7d4ed4c02d99807333a83b24d6 100644 --- a/module/VuFindSearch/src/VuFindSearch/Backend/Exception/BackendException.php +++ b/module/VuFindSearch/src/VuFindSearch/Backend/Exception/BackendException.php @@ -42,4 +42,44 @@ use VuFindSearch\Exception\RuntimeException; */ class BackendException extends RuntimeException { + /** + * Tags. + * + * @var array + */ + protected $tags = array(); + + /** + * Add a tag. + * + * @param string $tag Tag name + * + * @return void + */ + public function addTag($tag) + { + $this->tags[] = (string)$tag; + } + + /** + * Return all tags. + * + * @return array + */ + public function getTags() + { + return $this->tags; + } + + /** + * Return true if the exception has the requested tag. + * + * @param string $tag Tag + * + * @return boolean + */ + public function hasTag($tag) + { + return in_array($tag, $this->tags); + } }