eZPublishCommunityProject  2013.9
eZ\Publish\Core\MVC\Symfony\Matcher\AbstractMatcherFactory Class Reference

Base for MatcherFactory classes. More...

+ Inheritance diagram for eZ\Publish\Core\MVC\Symfony\Matcher\AbstractMatcherFactory:
+ Collaboration diagram for eZ\Publish\Core\MVC\Symfony\Matcher\AbstractMatcherFactory:

Public Member Functions

 __construct (Repository $repository, array $matchConfig)
 
 match (ValueObject $valueObject, $viewType)
 Checks if $valueObject has a usable configuration for $viewType. More...
 

Protected Member Functions

 doMatch (MatcherInterface $matcher, ValueObject $valueObject)
 Checks if $valueObject matches $matcher rules. More...
 
 getMatcher ($matcherIdentifier)
 Returns the matcher object. More...
 

Protected Attributes

 $alreadyMatched
 
 $matchConfig
 
 $matcherRelativeNamespace
 
 $matchers
 
 $repository
 

Detailed Description

Base for MatcherFactory classes.

Implementors can define MATCHER_RELATIVE_NAMESPACE constant. If so, getMatcher() will return instances of objects relative to this namespace if $matcherIdentifier argument doesn't begin with a '\' (FQ class name).

Constructor & Destructor Documentation

eZ\Publish\Core\MVC\Symfony\Matcher\AbstractMatcherFactory::__construct ( Repository  $repository,
array  $matchConfig 
)

Member Function Documentation

eZ\Publish\Core\MVC\Symfony\Matcher\AbstractMatcherFactory::doMatch ( MatcherInterface  $matcher,
ValueObject  $valueObject 
)
abstractprotected

Checks if $valueObject matches $matcher rules.

Parameters
\eZ\Publish\Core\MVC\Symfony\Matcher\MatcherInterface$matcher
ValueObject$valueObject
Returns
bool

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

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

Returns the matcher object.

Parameters
string$matcherIdentifierThe matcher class. If it begins with a '\' it means it's a FQ class name, otherwise it is relative to static::MATCHER_RELATIVE_NAMESPACE namespace (if available).
Exceptions
InvalidArgumentException
Returns

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

eZ\Publish\Core\MVC\Symfony\Matcher\AbstractMatcherFactory::match ( ValueObject  $valueObject,
  $viewType 
)

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\API\Repository\Values\ValueObject$valueObject
string$viewType
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.

Member Data Documentation

eZ\Publish\Core\MVC\Symfony\Matcher\AbstractMatcherFactory::$alreadyMatched
protected
eZ\Publish\Core\MVC\Symfony\Matcher\AbstractMatcherFactory::$matchConfig
protected
eZ\Publish\Core\MVC\Symfony\Matcher\AbstractMatcherFactory::$matcherRelativeNamespace
protected
eZ\Publish\Core\MVC\Symfony\Matcher\AbstractMatcherFactory::$matchers
protected
eZ\Publish\Core\MVC\Symfony\Matcher\AbstractMatcherFactory::$repository
protected

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