class EqualityConstraint implements ConstraintInterface

EqualityConstraint class.

The EqualityConstraint can be used to compare a resource's field or metadata against a specific value.

EqualityConstraints are one of the very basic constraints and are typically used ensure the type of a document or to match entries of a content type:

{
  "equals": [{"doc": "sys.type"}, "Asset"]
}

Methods

__construct(string $doc = '', $value = null)

EqualityConstraint constructor.

getDoc()

No description

setDoc(string $doc)

No description

mixed|null
getValue()

No description

setValue(mixed $value)

No description

jsonSerialize()

{@inheritdoc}

Details

at line 46
__construct(string $doc = '', $value = null)

EqualityConstraint constructor.

Parameters

string $doc
$value

at line 52
getDoc()

at line 60
EqualityConstraint setDoc(string $doc)

Parameters

string $doc

Return Value

EqualityConstraint

at line 70
mixed|null getValue()

Return Value

mixed|null

at line 80
EqualityConstraint setValue(mixed $value)

Parameters

mixed $value

Return Value

EqualityConstraint

at line 90
jsonSerialize()

{@inheritdoc}