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

Public Member Functions

 __construct (Context $context=null)
 
CompositeExpression buildExpression (array $queriedTables, ExpressionBuilder $expressionBuilder)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Database\Query\Restriction\AbstractRestrictionContainer
 removeAll ()
 
 removeByType (string $restrictionType)
 
 add (QueryRestrictionInterface $restriction)
 

Protected Member Functions

 createRestriction ($restrictionClass)
 

Protected Attributes

array $defaultRestrictionTypes
 
Context $context
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Core\Database\Query\Restriction\AbstractRestrictionContainer
QueryRestrictionInterface[] $restrictions = array( )
 
QueryRestrictionInterface[] $enforcedRestrictions = array( )
 

Detailed Description

A collection of restrictions to be used in frontend context. This is a replacement for PageRepository::enableFields()

Definition at line 29 of file FrontendRestrictionContainer.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer::__construct ( Context  $context = null)

Member Function Documentation

◆ buildExpression()

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

Main method to build expressions for given tables Iterates over all registered restrictions and removes the hidden restriction if preview is requested

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)

Reimplemented from TYPO3\CMS\Core\Database\Query\Restriction\AbstractRestrictionContainer.

Definition at line 65 of file FrontendRestrictionContainer.php.

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

◆ createRestriction()

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

Factory method for restrictions. Currently only instantiates the class.

Parameters
string$restrictionClass

Reimplemented from TYPO3\CMS\Core\Database\Query\Restriction\AbstractRestrictionContainer.

Definition at line 93 of file FrontendRestrictionContainer.php.

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

Member Data Documentation

◆ $context

Context TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer::$context
protected

◆ $defaultRestrictionTypes

array TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer::$defaultRestrictionTypes
protected
Initial value:
= [
DeletedRestriction::class,
WorkspaceRestriction::class,
HiddenRestriction::class,
StartTimeRestriction::class,
EndTimeRestriction::class,
FrontendGroupRestriction::class,
]

Definition at line 34 of file FrontendRestrictionContainer.php.