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

Core/MVC/Symfony/SiteAccess/Matcher/Compound/LogicalAnd.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Compound;
8
9 use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Compound;
10 use eZ\Publish\Core\MVC\Symfony\SiteAccess\VersatileMatcher;
11
15 class LogicalAnd extends Compound implements VersatileMatcher
16 {
17 const NAME = 'logicalAnd';
18
19 public function match()
20 {
21 foreach ($this->config as $i => $rule) {
22 foreach ($rule['matchers'] as $subMatcherClass => $matchingConfig) {
23 // If at least one sub matcher doesn't match, jump to the next rule set.
24 if ($this->matchersMap[$i][$subMatcherClass]->match() === false) {
25 continue 2;
26 }
27 }
28
29 $this->subMatchers = $this->matchersMap[$i];
30
31 return $rule['match'];
32 }
33
34 return false;
35 }
36
37 public function reverseMatch($siteAccessName)
38 {
39 foreach ($this->config as $i => $rule) {
40 if ($rule['match'] === $siteAccessName) {
41 $subMatchers = [];
42 foreach ($this->matchersMap[$i] as $subMatcher) {
43 if (!$subMatcher instanceof VersatileMatcher) {
44 return null;
45 }
46
47 $reverseMatcher = $subMatcher->reverseMatch($siteAccessName);
48 if (!$reverseMatcher) {
49 return null;
50 }
51
52 $subMatchers[] = $subMatcher;
53 }
54
55 $this->setSubMatchers($subMatchers);
56
57 return $this;
58 }
59 }
60 }
61 }
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Compound\LogicalAnd
Siteaccess matcher that allows a combination of matchers, with a logical AND.
Definition: Core/MVC/Symfony/SiteAccess/Matcher/Compound/LogicalAnd.php:16
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Compound\LogicalAnd\reverseMatch
reverseMatch($siteAccessName)
Returns matcher object corresponding to $siteAccessName or null if non applicable.
Definition: Core/MVC/Symfony/SiteAccess/Matcher/Compound/LogicalAnd.php:37
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Compound\LogicalAnd\NAME
const NAME
Definition: Core/MVC/Symfony/SiteAccess/Matcher/Compound/LogicalAnd.php:17
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Compound\LogicalAnd\match
match()
Returns matched Siteaccess or false if no siteaccess could be matched.
Definition: Core/MVC/Symfony/SiteAccess/Matcher/Compound/LogicalAnd.php:19
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Compound
Base for Compound siteaccess matchers.
Definition: Compound.php:19
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Compound\$subMatchers
$subMatchers
Definition: Compound.php:32
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Compound\setSubMatchers
setSubMatchers(array $subMatchers)
Replaces sub-matchers.
Definition: Compound.php:98
eZ\Publish\Core\MVC\Symfony\SiteAccess\VersatileMatcher
Interface for SiteAccess matchers.
Definition: VersatileMatcher.php:16
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Compound
Definition: Core/MVC/Symfony/SiteAccess/Matcher/Compound/LogicalAnd.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.