FrontendRestrictionContainer

class \TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer

Extends
AbstractRestrictionContainer

A collection of restrictions to be used in frontend context.

This is a replacement for PageRepository::enableFields()

Table of Contents

Properties

$context  : Context
$defaultRestrictionTypes  : string[]
$enforcedRestrictions  : QueryRestrictionInterface[]
$restrictions  : QueryRestrictionInterface[]

Methods

__construct()  : mixed
FrontendRestrictionContainer constructor.
add()  : QueryRestrictionContainerInterface
Add a new restriction instance to this collection
buildExpression()  : CompositeExpression
Main method to build expressions for given tables Iterates over all registered restrictions and removes the hidden restriction if preview is requested
removeAll()  : QueryRestrictionContainerInterface
Removes all restrictions stored within this container
removeByType()  : QueryRestrictionContainerInterface
Remove restriction of a given type
createRestriction()  : QueryRestrictionInterface
Factory method for restrictions.

Properties

$defaultRestrictionTypes

protected string[] $defaultRestrictionTypes = [\TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestricti…
Show the full value[\TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction::class, \TYPO3\CMS\Core\Database\Query\Restriction\WorkspaceRestriction::class, \TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction::class, \TYPO3\CMS\Core\Database\Query\Restriction\StartTimeRestriction::class, \TYPO3\CMS\Core\Database\Query\Restriction\EndTimeRestriction::class, \TYPO3\CMS\Core\Database\Query\Restriction\FrontendGroupRestriction::class]

Methods

__construct()

FrontendRestrictionContainer constructor.

public __construct([Context|null $context = null ]) : mixed

Initializes the default restrictions for frontend requests

Parameters

$context : Context|null = null

buildExpression()

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

public buildExpression(array $queriedTables, ExpressionBuilder $expressionBuilder) : CompositeExpression

Parameters

$queriedTables : array

Array of tables, where array key is table alias and value is a table name

$expressionBuilder : ExpressionBuilder

Expression builder instance to add restrictions with

Return values

CompositeExpression —

The result of query builder expression(s)

On this page