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

Publish/Core/MVC/Symfony/Matcher/BlockMatcherFactory.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\MVC\Symfony\Matcher;
8
9 use eZ\Publish\API\Repository\Values\ValueObject;
10 use eZ\Publish\Core\MVC\Symfony\Matcher\Block\MatcherInterface as BlockMatcherInterface;
11 use eZ\Publish\Core\MVC\Symfony\Matcher\MatcherInterface as BaseMatcherInterface;
12 use eZ\Publish\Core\MVC\Symfony\View\View;
13 use InvalidArgumentException;
14
18 class BlockMatcherFactory extends AbstractMatcherFactory
19 {
20 const MATCHER_RELATIVE_NAMESPACE = 'eZ\\Publish\\Core\\MVC\\Symfony\\Matcher\\Block';
21
22 protected function getMatcher($matcherIdentifier)
23 {
24 @trigger_error(
25 "BlockMatcherFactory is deprecated, and will be removed in ezpublish-kernel 6.1.\n" .
26 'Use the ServiceAwareMatcherFactory with the relative namespace as a constructor argument instead.',
27 E_USER_DEPRECATED
28 );
29
30 $matcher = parent::getMatcher($matcherIdentifier);
31 if (!$matcher instanceof BlockMatcherInterface) {
32 throw new InvalidArgumentException(
33 'Matcher for Blocks must implement eZ\\Publish\\Core\\MVC\\Symfony\\Matcher\\Block\\MatcherInterface.'
34 );
35 }
36
37 return $matcher;
38 }
39
50 protected function doMatch(BaseMatcherInterface $matcher, View $view)
51 {
52 return $matcher->match($view);
53 }
54 }
eZ\Publish\API\Repository\Values\ValueObject
Definition: API/Repository/Values/ValueObject.php:21
eZ\Publish\Core\MVC\Symfony\Matcher\AbstractMatcherFactory
Base for MatcherFactory classes.
Definition: AbstractMatcherFactory.php:24
eZ\Publish\Core\MVC\Symfony\Matcher\BlockMatcherFactory
Definition: Publish/Core/MVC/Symfony/Matcher/BlockMatcherFactory.php:19
eZ\Publish\Core\MVC\Symfony\Matcher\BlockMatcherFactory\getMatcher
getMatcher($matcherIdentifier)
Returns the matcher object.
Definition: Publish/Core/MVC/Symfony/Matcher/BlockMatcherFactory.php:22
eZ\Publish\Core\MVC\Symfony\Matcher\BlockMatcherFactory\doMatch
doMatch(BaseMatcherInterface $matcher, View $view)
Checks if $valueObject matches $matcher rules.
Definition: Publish/Core/MVC/Symfony/Matcher/BlockMatcherFactory.php:50
eZ\Publish\Core\MVC\Symfony\Matcher\BlockMatcherFactory\MATCHER_RELATIVE_NAMESPACE
const MATCHER_RELATIVE_NAMESPACE
Definition: Publish/Core/MVC/Symfony/Matcher/BlockMatcherFactory.php:20
eZ\Publish\Core\MVC\Symfony\Matcher\Block\MatcherInterface
Main interface for block matchers.
Definition: Block/MatcherInterface.php:16
eZ\Publish\Core\MVC\Symfony\Matcher\MatcherInterface
Base interface for matchers.
Definition: MatcherInterface.php:15
eZ\Publish\Core\MVC\Symfony\View\View
Main interface for Views of Value objects (content, block...).
Definition: Publish/Core/MVC/Symfony/View/View.php:16
eZ\Publish\Core\MVC\Symfony\Matcher
Definition: AbstractMatcherFactory.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.