‪TYPO3CMS  ‪main
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)
 
 removeAll ()
 
 removeByType (string $restrictionType)
 
 add (QueryRestrictionInterface $restriction)
 

Protected Member Functions

 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\and().

◆ createRestriction()

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

Factory method for restrictions. Currently only instantiates the class.

Parameters
string$restrictionClass

Reimplemented in TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer.

Definition at line 105 of file AbstractRestrictionContainer.php.

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

◆ removeAll()

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

◆ removeByType()

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

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

Definition at line 68 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.