LimitToTablesRestrictionContainer implements QueryRestrictionContainerInterface
Restriction container that applies added restrictions only to the given table aliases.
Enforced restrictions are treated equally to all other restrictions.
Table of Contents
Interfaces
- QueryRestrictionContainerInterface
- Interface that all restriction collections must implement.
Methods
- add() : QueryRestrictionContainerInterface
- Add a new restriction instance to this collection
- addForTables() : QueryRestrictionContainerInterface
- Adds the restriction, but also remembers which table aliases it should be applied to
- buildExpression() : CompositeExpression
- Main method to build expressions for given tables, but respecting configured filters.
- removeAll() : QueryRestrictionContainerInterface
- Removes all restrictions stored within this container
- removeByType() : QueryRestrictionContainerInterface
- Remove restriction of a given type
Methods
add()
Add a new restriction instance to this collection
public
add(QueryRestrictionInterface $restriction) : QueryRestrictionContainerInterface
Parameters
- $restriction : QueryRestrictionInterface
Return values
QueryRestrictionContainerInterfaceaddForTables()
Adds the restriction, but also remembers which table aliases it should be applied to
public
addForTables(QueryRestrictionInterface $restriction, array<string|int, mixed> $tableAliases) : QueryRestrictionContainerInterface
Parameters
- $restriction : QueryRestrictionInterface
- $tableAliases : array<string|int, mixed>
-
flat array of table aliases, not table names
Return values
QueryRestrictionContainerInterfacebuildExpression()
Main method to build expressions for given tables, but respecting configured filters.
public
buildExpression(array<string|int, mixed> $queriedTables, ExpressionBuilder $expressionBuilder) : CompositeExpression
Parameters
- $queriedTables : array<string|int, mixed>
-
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)
removeAll()
Removes all restrictions stored within this container
public
removeAll() : QueryRestrictionContainerInterface
Return values
QueryRestrictionContainerInterfaceremoveByType()
Remove restriction of a given type
public
removeByType(string $restrictionType) : QueryRestrictionContainerInterface
Parameters
- $restrictionType : string
-
Class name of the restriction to be removed