class OrConstraint extends LogicConstraint

OrConstraint class.

The OrConstaint 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

__construct(array $children = [])

LogicConstraint constructor.

string
getOperator()

No description

setChildren(array $children)

No description

array
jsonSerialize()

Returns an array to be used by "json_encode" to serialize objects of this class.

Details

in LogicConstraint at line 28
__construct(array $children = [])

LogicConstraint constructor.

Parameters

array $children

at line 38
protected string getOperator()

Return Value

string

in LogicConstraint at line 41
ConstraintInterface[] getChildren()

Return Value

ConstraintInterface[]

in LogicConstraint at line 51
LogicConstraint addChild(ConstraintInterface $child)

Parameters

ConstraintInterface $child

Return Value

LogicConstraint

in LogicConstraint at line 63
LogicConstraint setChildren(array $children)

Parameters

array $children

Return Value

LogicConstraint

in LogicConstraint at line 82
LogicConstraint clearChildren()

Return Value

LogicConstraint

in LogicConstraint at line 94
array jsonSerialize()

Returns an array to be used by "json_encode" to serialize objects of this class.

Return Value

array