In the siteaccess configuration, if the matcher class begins with a "\" (FQ class name), it will be used as is, passing the matching configuration in the constructor.
Otherwise, given matching class will be relative to eZ\Publish\Core\MVC\Symfony\SiteAccess namespace.
public buildMatcher ( string $matcherIdentifier, mixed $matchingConfiguration, |
||
$matcherIdentifier | string | "Identifier" of the matcher to build (i.e. its FQ class name). |
$matchingConfiguration | mixed | Configuration to pass to the matcher. Can be anything the matcher supports. |
$request | The request to match against. | |
return | eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher |
/** * Builds siteaccess matcher. * If $matchingClass begins with "@", it will be considered as a service identifier and loaded with the service container. * * @param $matchingClass * @param $matchingConfiguration * @param \eZ\Publish\Core\MVC\Symfony\Routing\SimplifiedRequest $request * * @return \eZ\Bundle\EzPublishCoreBundle\SiteAccess\Matcher * * @throws \RuntimeException * */ public function buildMatcher($matchingClass, $matchingConfiguration, SimplifiedRequest $request) { if ($matchingClass[0] === '@') { /** @var $matcher \eZ\Bundle\EzPublishCoreBundle\SiteAccess\Matcher */ $matcher = $this->container->get(substr($matchingClass, 1)); if (!$matcher instanceof Matcher) { throw new RuntimeException('A service based siteaccess matcher MUST implement ' . __NAMESPACE__ . '\\Matcher interface.'); } $matcher->setMatchingConfiguration($matchingConfiguration); $matcher->setRequest($request); return $matcher; } return parent::buildMatcher($matchingClass, $matchingConfiguration, $request); }