‪TYPO3CMS  10.4
TYPO3\CMS\Core\Database\Query\Restriction\AbstractRestrictionContainer Class Reference
Inheritance diagram for TYPO3\CMS\Core\Database\Query\Restriction\AbstractRestrictionContainer:
TYPO3\CMS\Core\Database\Query\Restriction\QueryRestrictionContainerInterface TYPO3\CMS\Core\Database\Query\Restriction\QueryRestrictionInterface TYPO3\CMS\Core\Database\Query\Restriction\DefaultRestrictionContainer TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer TYPO3\CMS\Core\Resource\Search\QueryRestrictions\FolderMountsRestriction TYPO3\CMS\Core\Resource\Search\QueryRestrictions\FolderRestriction TYPO3\CMS\Core\Tests\Unit\Database\Mocks\InstantiatableAbstractRestrictionContainer

Public Member Functions

CompositeExpression buildExpression (array $queriedTables, ExpressionBuilder $expressionBuilder)
 
QueryRestrictionContainerInterface removeAll ()
 
QueryRestrictionContainerInterface removeByType (string $restrictionType)
 
QueryRestrictionContainerInterface add (QueryRestrictionInterface $restriction)
 

Protected Member Functions

QueryRestrictionInterface createRestriction ($restrictionClass)
 

Protected Attributes

QueryRestrictionInterface[] $restrictions = array( )
 
QueryRestrictionInterface[] $enforcedRestrictions = array( )
 

Detailed Description

Base class for query restriction collections

Definition at line 27 of file AbstractRestrictionContainer.php.

Member Function Documentation

◆ add()

◆ buildExpression()

CompositeExpression TYPO3\CMS\Core\Database\Query\Restriction\AbstractRestrictionContainer::buildExpression ( array  $queriedTables,
ExpressionBuilder  $expressionBuilder 
)

Main method to build expressions for given tables. Iterating over all registered expressions and combine them with AND

Parameters
array$queriedTables‪Array of tables, where array key is table alias and value is a table name
ExpressionBuilder$expressionBuilderExpression builder instance to add restrictions with
Returns
‪CompositeExpression The result of query builder expression(s)

Implements TYPO3\CMS\Core\Database\Query\Restriction\QueryRestrictionInterface.

Reimplemented in TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer, and TYPO3\CMS\Core\Resource\Search\QueryRestrictions\FolderMountsRestriction.

Definition at line 45 of file AbstractRestrictionContainer.php.

References TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\andX().

◆ createRestriction()

QueryRestrictionInterface TYPO3\CMS\Core\Database\Query\Restriction\AbstractRestrictionContainer::createRestriction (   $restrictionClass)
protected

Factory method for restrictions. Currently only instantiates the class.

Parameters
string$restrictionClass
Returns
QueryRestrictionInterface

Definition at line 99 of file AbstractRestrictionContainer.php.

Referenced by TYPO3\CMS\Core\Database\Query\Restriction\DefaultRestrictionContainer\__construct(), and TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer\__construct().

◆ removeAll()

QueryRestrictionContainerInterface TYPO3\CMS\Core\Database\Query\Restriction\AbstractRestrictionContainer::removeAll ( )

◆ removeByType()

QueryRestrictionContainerInterface TYPO3\CMS\Core\Database\Query\Restriction\AbstractRestrictionContainer::removeByType ( string  $restrictionType)

Remove restriction of a given type

Parameters
string$restrictionType‪Class name of the restriction to be removed
Returns
QueryRestrictionContainerInterface

Implements TYPO3\CMS\Core\Database\Query\Restriction\QueryRestrictionContainerInterface.

Definition at line 71 of file AbstractRestrictionContainer.php.

Member Data Documentation

◆ $enforcedRestrictions

QueryRestrictionInterface [] TYPO3\CMS\Core\Database\Query\Restriction\AbstractRestrictionContainer::$enforcedRestrictions = array( )
protected

◆ $restrictions

QueryRestrictionInterface [] TYPO3\CMS\Core\Database\Query\Restriction\AbstractRestrictionContainer::$restrictions = array( )
protected

Definition at line 31 of file AbstractRestrictionContainer.php.