‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Database\Query\Restriction\LimitToTablesRestrictionContainer Class Reference
Inheritance diagram for TYPO3\CMS\Core\Database\Query\Restriction\LimitToTablesRestrictionContainer:
TYPO3\CMS\Core\Database\Query\Restriction\QueryRestrictionContainerInterface TYPO3\CMS\Core\Database\Query\Restriction\QueryRestrictionInterface

Public Member Functions

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

Private Member Functions

 filterApplicableTableAliases (array $queriedTables, string $name)
 

Private Attributes

QueryRestrictionInterface[] $restrictions = array( )
 
QueryRestrictionContainerInterface[] $restrictionContainer = array( )
 
array $applicableTableAliases
 

Detailed Description

Restriction container that applies added restrictions only to the given table aliases. Enforced restrictions are treated equally to all other restrictions.

Definition at line 27 of file LimitToTablesRestrictionContainer.php.

Member Function Documentation

◆ add()

TYPO3\CMS\Core\Database\Query\Restriction\LimitToTablesRestrictionContainer::add ( QueryRestrictionInterface  $restriction)

◆ addForTables()

TYPO3\CMS\Core\Database\Query\Restriction\LimitToTablesRestrictionContainer::addForTables ( QueryRestrictionInterface  $restriction,
array  $tableAliases 
)

Adds the restriction, but also remembers which table aliases it should be applied to

Parameters
array$tableAliases‪flat array of table aliases, not table names

Definition at line 70 of file LimitToTablesRestrictionContainer.php.

References TYPO3\CMS\Core\Database\Query\Restriction\LimitToTablesRestrictionContainer\add().

◆ buildExpression()

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

Main method to build expressions for given tables, but respecting configured filters.

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.

Definition at line 83 of file LimitToTablesRestrictionContainer.php.

References TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\and(), and TYPO3\CMS\Core\Database\Query\Restriction\LimitToTablesRestrictionContainer\filterApplicableTableAliases().

◆ filterApplicableTableAliases()

TYPO3\CMS\Core\Database\Query\Restriction\LimitToTablesRestrictionContainer::filterApplicableTableAliases ( array  $queriedTables,
string  $name 
)
private

◆ removeAll()

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

Removes all restrictions stored within this container

Returns
QueryRestrictionContainerInterface

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

Definition at line 41 of file LimitToTablesRestrictionContainer.php.

◆ removeByType()

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

Member Data Documentation

◆ $applicableTableAliases

array TYPO3\CMS\Core\Database\Query\Restriction\LimitToTablesRestrictionContainer::$applicableTableAliases
private

Definition at line 39 of file LimitToTablesRestrictionContainer.php.

◆ $restrictionContainer

QueryRestrictionContainerInterface [] TYPO3\CMS\Core\Database\Query\Restriction\LimitToTablesRestrictionContainer::$restrictionContainer = array( )
private

◆ $restrictions

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

Definition at line 31 of file LimitToTablesRestrictionContainer.php.