EntityCondition
class EntityCondition (View source)
| internal | JSON:API maintains no PHP API since its API is the HTTP API. This class may change at any time and this will break any dependencies on it. |
A condition object for the EntityQuery.
Constants
| PATH_KEY |
The field key in the filter condition: filter[lorem][condition][ |
| VALUE_KEY |
The value key in the filter condition: filter[lorem][condition][ |
| OPERATOR_KEY |
The operator key in the condition: filter[lorem][condition][ |
Properties
| static string[] | $allowedOperators | The allowed condition operators. |
|
| protected string | $field | The field to be evaluated. |
|
| protected string | $operator | The condition operator. |
|
| protected mixed | $value | The value against which the field should be evaluated. |
Methods
Constructs a new EntityCondition object.
The field to be evaluated.
The comparison operator to use for the evaluation.
The value against which the condition should be evaluated.
Creates an EntityCondition object from a query parameter.
Validates the filter has the required fields.
Details
__construct($field, $value, $operator = NULL)
Constructs a new EntityCondition object.
string
field()
The field to be evaluated.
string
operator()
The comparison operator to use for the evaluation.
For a list of allowed operators:
mixed
value()
The value against which the condition should be evaluated.
static EntityCondition
createFromQueryParameter(mixed $parameter)
Creates an EntityCondition object from a query parameter.
static protected
validate($parameter)
Validates the filter has the required fields.