AndConstraint
class AndConstraint extends LogicConstraint
AndConstraint class.
The AndConstraint evaluates if all its conditions are true. The value of the AndConstraint needs to be an array, with an arbitrary amount of constraints.
The AndConstraint is necessary and useful for a broad variety of use cases. An example for the constraint is the limitation to a specific content type:
{
"and": [
{"equals": [{"doc": "sys.type"}, "Entry"]},
{"equals": [{"doc": "sys.contentType.sys.id"}, "content-type-id"]}
]
}
Properties
protected ConstraintInterface[] | $children | from LogicConstraint |
Methods
string
getOperator()
No description
array
jsonSerialize()
Returns an array to be used by "json_encode" to serialize objects of this class.
from LogicConstraint
Details
in LogicConstraint at line 28
__construct(array $children = [])
LogicConstraint constructor.
at line 37
protected string
getOperator()
in LogicConstraint at line 41
ConstraintInterface[]
getChildren()
in LogicConstraint at line 51
LogicConstraint
addChild(ConstraintInterface $child)
in LogicConstraint at line 63
LogicConstraint
setChildren(array $children)
in LogicConstraint at line 82
LogicConstraint
clearChildren()
in LogicConstraint at line 94
array
jsonSerialize()
Returns an array to be used by "json_encode" to serialize objects of this class.