‪TYPO3CMS  ‪main
TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeConditionMatcherVisitor Class Reference
Inheritance diagram for TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeConditionMatcherVisitor:
TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeVisitorInterface

Public Member Functions

 __construct (private readonly Context $context, private readonly PageLayoutResolver $pageLayoutResolver,)
 
 initializeExpressionMatcherWithVariables (array $variables)
 
 getConditionListWithVerdicts ()
 
 visitBeforeChildren (IncludeInterface $include, int $currentDepth)
 
 visit (IncludeInterface $include, int $currentDepth)
 

Private Attributes

Resolver $resolver
 
array $conditionList = []
 

Detailed Description

A visitor that looks at IncludeConditionInterface nodes and evaluates their conditions.

Condition matching is done in visitBeforeChildren() to be used in combination with ConditionVerdictAwareIncludeTreeTraverser, so children are only traversed for conditions that evaluated true.

: Internal tree structure.

Definition at line 43 of file IncludeTreeConditionMatcherVisitor.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeConditionMatcherVisitor::__construct ( private readonly Context  $context,
private readonly PageLayoutResolver  $pageLayoutResolver 
)

Definition at line 50 of file IncludeTreeConditionMatcherVisitor.php.

Member Function Documentation

◆ getConditionListWithVerdicts()

TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeConditionMatcherVisitor::getConditionListWithVerdicts ( )

A list of all handled conditions with their verdicts. This is used in FE since condition verdicts influence page caches.

Definition at line 147 of file IncludeTreeConditionMatcherVisitor.php.

References TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeConditionMatcherVisitor\$conditionList.

◆ initializeExpressionMatcherWithVariables()

TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeConditionMatcherVisitor::initializeExpressionMatcherWithVariables ( array  $variables)

Prepare the core expression language Resolver class - our API to symfony expression language - for typoscript context usage.

The method gets a series of variables hand over coming from caller scope like rootline, page array and eventually a request object. These vars are munged around a bit and enriched with a series of semi-static state variables: Things that can be injected like derived from context, for example frontend / backend user, workspace and similar. This ensures all typoscript 'conditions' receive similar structured data.

Definition at line 66 of file IncludeTreeConditionMatcherVisitor.php.

◆ visit()

TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeConditionMatcherVisitor::visit ( IncludeInterface  $include,
int  $currentDepth 
)

Main visit method called for each node.

Implements TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeVisitorInterface.

Definition at line 177 of file IncludeTreeConditionMatcherVisitor.php.

◆ visitBeforeChildren()

TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeConditionMatcherVisitor::visitBeforeChildren ( IncludeInterface  $include,
int  $currentDepth 
)

Let symfony expression language handle the expression, gather expressions that have been handled since they influence page caching, negate expression verdicts if they're a [else] expression.

Implements TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeVisitorInterface.

Definition at line 157 of file IncludeTreeConditionMatcherVisitor.php.

Member Data Documentation

◆ $conditionList

array TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeConditionMatcherVisitor::$conditionList = []
private

◆ $resolver

Resolver TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeConditionMatcherVisitor::$resolver
private

Definition at line 47 of file IncludeTreeConditionMatcherVisitor.php.