class NotConstraint implements ConstraintInterface

NotConstraint class.

The NotConstraint inverts the result of its value. The value of the NotConstraint must be another constraint.

A typical use case for the NotConstraint is the inversion of whitelists to blacklists. If for example a user should not be able to see entries of a specific content type, it can either be achieved by denying access to those content types or by allowing access to all but the entries of the content type:

{
  "not": {
    "equals": [{"doc": "sys.contentType.sys.id"}, "content-type-id"]
  }
}

Methods

__construct(ConstraintInterface $child = null)

NotConstraint constructor.

getChild()

No description

setChild(ConstraintInterface $child)

No description

jsonSerialize()

{@inheritdoc}

Details

at line 43
__construct(ConstraintInterface $child = null)

NotConstraint constructor.

Parameters

ConstraintInterface $child

at line 51
ConstraintInterface|null getChild()

Return Value

ConstraintInterface|null

at line 59
NotConstraint setChild(ConstraintInterface $child)

Parameters

ConstraintInterface $child

Return Value

NotConstraint

at line 69
jsonSerialize()

{@inheritdoc}