getMatcher() protected method

Returns the matcher object.
protected getMatcher ( string $matcherIdentifier ) : eZ\Publish\Core\MVC\Symfony\Matcher\MatcherInterface | eZ\Publish\Core\MVC\Symfony\Matcher\ViewMatcherInterface
$matcherIdentifier string The matcher identifier. If it begins with a '\' it means it's a FQ class name. If it does not and a relative namespace is set, it is searched inside the relative namespace if set.
return eZ\Publish\Core\MVC\Symfony\Matcher\MatcherInterface | eZ\Publish\Core\MVC\Symfony\Matcher\ViewMatcherInterface
 /**
  * @param string $matcherIdentifier
  *
  * @return \eZ\Publish\Core\MVC\Symfony\Matcher\ContentBased\MatcherInterface
  */
 protected function getMatcher($matcherIdentifier)
 {
     if ($this->container->has($matcherIdentifier)) {
         return $this->container->get($matcherIdentifier);
     }
     return parent::getMatcher($matcherIdentifier);
 }
Example #2
0
 /**
  * Returns the matcher object.
  *
  * @param string $matcherIdentifier The matcher class.
  *        If it begins with a '\' it means it's a fully qualified class name,
  *        otherwise it is relative to provided namespace (if available).
  *
  * @throws \InvalidArgumentException If no matcher could be found
  *
  * @return \eZ\Publish\Core\MVC\Symfony\Matcher\ViewMatcherInterface
  */
 protected function getMatcher($matcherIdentifier)
 {
     if ($this->container->has($matcherIdentifier)) {
         return $this->container->get($matcherIdentifier);
     }
     $matcher = parent::getMatcher($matcherIdentifier);
     if (!$matcher instanceof ViewMatcherInterface) {
         throw new InvalidArgumentException('Matcher for tags must implement eZ\\Publish\\Core\\MVC\\Symfony\\Matcher\\ViewMatcherInterface.');
     }
     if ($matcher instanceof TagsServiceAwareInterface) {
         $matcher->setTagsService($this->tagsService);
     }
     if ($matcher instanceof MultipleValued) {
         $matcher->setTranslationHelper($this->translationHelper);
     }
     return $matcher;
 }