Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory Class Reference

A matcher factory based on namespaces: matchers will be searched for as classes. More...

Inheritance diagram for eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory:

## Public Member Functions
| __construct (Repository $repository, $relativeNamespace=null, array $matchConfig=[])
| match (View $view)
| Checks if $valueObject has a usable configuration for $viewType. More...
| setMatchConfig ($matchConfig)

## Protected Member Functions
| getMatcher ($matcherIdentifier)
| Returns the matcher object. More...

## Protected Attributes
| $repository
| $matchConfig
| $matchers = []
| $matcherRelativeNamespace
| $alreadyMatched = []

## Detailed Description

A matcher factory based on namespaces: matchers will be searched for as classes.

A relative namespace can be defined. If so, getMatcher() will search for the requested matcher inside this namespace if a relative namespace (not starting with '\') is passed.

Definition at line 21 of file ClassNameMatcherFactory.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory::__construct | ( | Repository | $repository,
|  |  | $relativeNamespace = `null`,
|  | array | $matchConfig = `[]`
| ) |  |

Definition at line 52 of file ClassNameMatcherFactory.php.

References eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory\$matchConfig, and eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory\$repository.

## Member Function Documentation

## ◆ getMatcher()

eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory::getMatcher | ( |  | $matcherIdentifier | ) |
| protected

Returns the matcher object.

Parameters

  string | $matcherIdentifier | 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.

Exceptions

  InvalidArgumentException |

Returns
  \eZ\Publish\Core\MVC\Symfony\Matcher\MatcherInterface|\eZ\Publish\Core\MVC\Symfony\Matcher\ViewMatcherInterface

Reimplemented in eZ\Bundle\EzPublishCoreBundle\Matcher\ServiceAwareMatcherFactory.

Definition at line 71 of file ClassNameMatcherFactory.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory\match().

## ◆ match()

eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory::match | ( | View | $view | ) |

Checks if $valueObject has a usable configuration for $viewType.

If so, the configuration hash will be returned. $valueObject can be for example a Location or a Content object.

Parameters

  \eZ\Publish\Core\MVC\Symfony\View\View | $view |

Returns
  array|null The matched configuration as a hash, containing template or controller to use, or null if not matched.

Implements eZ\Publish\Core\MVC\Symfony\Matcher\MatcherFactoryInterface.

Definition at line 104 of file ClassNameMatcherFactory.php.

References eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory\getMatcher(), and eZ\Publish\Core\MVC\Symfony\View\View\getViewType().

## ◆ setMatchConfig()

eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory::setMatchConfig | ( |  | $matchConfig | ) |

Parameters

  array | $matchConfig |

Returns
  AbstractMatcherFactory

Definition at line 145 of file ClassNameMatcherFactory.php.

References eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory\$matchConfig.

## Member Data Documentation

## ◆ $alreadyMatched

eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory::$alreadyMatched = []
| protected

Definition at line 50 of file ClassNameMatcherFactory.php.

## ◆ $matchConfig

eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory::$matchConfig
| protected

Definition at line 32 of file ClassNameMatcherFactory.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory\__construct(), and eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory\setMatchConfig().

## ◆ $matcherRelativeNamespace

eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory::$matcherRelativeNamespace
| protected

Definition at line 42 of file ClassNameMatcherFactory.php.

## ◆ $matchers

eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory::$matchers = []
| protected

Definition at line 35 of file ClassNameMatcherFactory.php.

## ◆ $repository

eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory::$repository
| protected

Definition at line 24 of file ClassNameMatcherFactory.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Matcher\ClassNameMatcherFactory\__construct().

The documentation for this class was generated from the following file:

- ClassNameMatcherFactory.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.