OrConstraint
class OrConstraint extends LogicConstraint
OrConstraint class.
The OrConstraint evaluates if one if its conditions returns true. The value of the OrConstraint needs to be an array, with an arbitrary amount of constraints.
OrConstraint can be used to enable an effect for various different resources. E.g. a user should only be allowed to read entries of a specific content type or all assets:
{
"or": [
{"equals": [{"doc": "sys.type"}, "Entry"]},
{"equals": [{"doc": "sys.type"}, "Asset"]}
]
}
Properties
protected ConstraintInterface[] | $children | from LogicConstraint |
Methods
string
getOperator()
No description
Details
in LogicConstraint at line 29
__construct(array $children = [])
LogicConstraint constructor.
at line 39
protected string
getOperator()
in LogicConstraint at line 42
ConstraintInterface[]
getChildren()
in LogicConstraint at line 52
LogicConstraint
addChild(ConstraintInterface $child)
in LogicConstraint at line 64
LogicConstraint
setChildren(array $children)
in LogicConstraint at line 83
LogicConstraint
clearChildren()
in LogicConstraint at line 93
jsonSerialize()
{@inheritdoc}