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

Bundle/EzPublishCoreBundle/Matcher/BlockMatcherFactory.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Bundle\EzPublishCoreBundle\Matcher;
8
9 use eZ\Publish\API\Repository\Repository;
10 use eZ\Publish\Core\MVC\ConfigResolverInterface;
11 use eZ\Publish\Core\MVC\Symfony\Matcher\BlockMatcherFactory as BaseFactory;
12 use eZ\Publish\Core\MVC\Symfony\SiteAccess\SiteAccessAware;
13 use eZ\Publish\Core\MVC\Symfony\SiteAccess;
14 use Symfony\Component\DependencyInjection\ContainerAwareInterface;
15 use Symfony\Component\DependencyInjection\ContainerAwareTrait;
16
20 class BlockMatcherFactory extends BaseFactory implements SiteAccessAware, ContainerAwareInterface
21 {
22 use ContainerAwareTrait;
23
25 private $configResolver;
26
27 public function __construct(ConfigResolverInterface $configResolver, Repository $repository)
28 {
29 @trigger_error(
30 "BlockMatcherFactory is deprecated, and will be removed in ezpublish-kernel 6.1.\n" .
31 'Use the ServiceAwareMatcherFactory with the relative namespace as a constructor argument.',
32 E_USER_DEPRECATED
33 );
34
35 $this->configResolver = $configResolver;
36 parent::__construct(
37 $repository,
38 $this->configResolver->getParameter('block_view')
39 );
40 }
41
47 protected function getMatcher($matcherIdentifier)
48 {
49 if ($this->container->has($matcherIdentifier)) {
50 return $this->container->get($matcherIdentifier);
51 }
52
53 return parent::getMatcher($matcherIdentifier);
54 }
55
61 public function setSiteAccess(SiteAccess $siteAccess = null)
62 {
63 if ($siteAccess === null) {
64 return;
65 }
66
67 $this->matchConfig = $this->configResolver->getParameter('block_view', 'ezsettings', $siteAccess->name);
68 }
69 }
eZ\Bundle\EzPublishCoreBundle\Matcher\BlockMatcherFactory
Definition: Bundle/EzPublishCoreBundle/Matcher/BlockMatcherFactory.php:21
eZ\Bundle\EzPublishCoreBundle\Matcher\BlockMatcherFactory\__construct
__construct(ConfigResolverInterface $configResolver, Repository $repository)
Definition: Bundle/EzPublishCoreBundle/Matcher/BlockMatcherFactory.php:27
eZ\Bundle\EzPublishCoreBundle\Matcher\BlockMatcherFactory\$configResolver
$configResolver
Definition: Bundle/EzPublishCoreBundle/Matcher/BlockMatcherFactory.php:25
eZ\Bundle\EzPublishCoreBundle\Matcher\BlockMatcherFactory\setSiteAccess
setSiteAccess(SiteAccess $siteAccess=null)
Changes internal configuration to use the one for passed SiteAccess.
Definition: Bundle/EzPublishCoreBundle/Matcher/BlockMatcherFactory.php:61
eZ\Bundle\EzPublishCoreBundle\Matcher\BlockMatcherFactory\getMatcher
getMatcher($matcherIdentifier)
Definition: Bundle/EzPublishCoreBundle/Matcher/BlockMatcherFactory.php:47
eZ\Publish\Core\MVC\Symfony\Matcher\AbstractMatcherFactory\$repository
$repository
Definition: AbstractMatcherFactory.php:26
eZ\Publish\Core\MVC\Symfony\Matcher\BlockMatcherFactory
Definition: Publish/Core/MVC/Symfony/Matcher/BlockMatcherFactory.php:19
eZ\Publish\Core\MVC\Symfony\SiteAccess
Base struct for a siteaccess representation.
Definition: SiteAccess.php:16
eZ\Publish\API\Repository\Repository
Repository interface.
Definition: API/Repository/Repository.php:16
eZ\Publish\Core\MVC\ConfigResolverInterface
Interface for config resolvers.
Definition: ConfigResolverInterface.php:19
eZ\Publish\Core\MVC\Symfony\SiteAccess\SiteAccessAware
Interface for SiteAccess aware services.
Definition: SiteAccessAware.php:15
eZ\Bundle\EzPublishCoreBundle\Matcher
Definition: Bundle/EzPublishCoreBundle/Matcher/BlockMatcherFactory.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.