TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
AbstractRestrictionContainer Class Reference
Inheritance diagram for AbstractRestrictionContainer:
QueryRestrictionContainerInterface QueryRestrictionInterface DefaultRestrictionContainer FrontendRestrictionContainer

Public Member Functions

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

Protected Member Functions

 createRestriction ($restrictionClass)
 

Protected Attributes

 $restrictions = []
 

Detailed Description

Base class for query restriction collections

Definition at line 25 of file AbstractRestrictionContainer.php.

Member Function Documentation

add ( QueryRestrictionInterface  $restriction)

Add a new restriction instance to this collection

Parameters
QueryRestrictionInterface$restriction
Returns
QueryRestrictionContainerInterface

Implements QueryRestrictionContainerInterface.

Definition at line 78 of file AbstractRestrictionContainer.php.

Referenced by DefaultRestrictionContainer\__construct(), and FrontendRestrictionContainer\__construct().

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$queriedTablesArray of tables, where array key is table name and value potentially an alias
ExpressionBuilder$expressionBuilderExpression builder instance to add restrictions with
Returns
CompositeExpression The result of query builder expression(s)

Implements QueryRestrictionInterface.

Definition at line 40 of file AbstractRestrictionContainer.php.

References ExpressionBuilder\andX().

createRestriction (   $restrictionClass)
protected

Factory method for restrictions. Currently only instantiates the class.

Parameters
string$restrictionClass
Returns
QueryRestrictionInterface

Definition at line 91 of file AbstractRestrictionContainer.php.

References GeneralUtility\makeInstance().

Referenced by DefaultRestrictionContainer\__construct(), and FrontendRestrictionContainer\__construct().

removeAll ( )

Removes all restrictions stored within this container

Returns
QueryRestrictionContainerInterface

Implements QueryRestrictionContainerInterface.

Definition at line 54 of file AbstractRestrictionContainer.php.

removeByType ( string  $restrictionType)

Remove restriction of a given type

Parameters
string$restrictionTypeClass name of the restriction to be removed
Returns
QueryRestrictionContainerInterface

Implements QueryRestrictionContainerInterface.

Definition at line 66 of file AbstractRestrictionContainer.php.

Member Data Documentation

$restrictions = []
protected

Definition at line 30 of file AbstractRestrictionContainer.php.