Criterion objects, used by the Public API to search for content, are all different, and require to be documented as a reference.
- what value format the Criterion accepts
- what operators are supported
- what they can "target" (e.g. apply to)
Built-in criterion objects are declared in eZ/Publish/API/Repository/Values/Content/Query/Criterion.
Some of the criteria are documented in PHPDoc, like ContentId. Others are not...
Each Criterion constructor will support up to three parameters: target, operator and value. Some only support value, some only value & operator, and so on.
In this example: the criterion (Criterion\ContentId only accepts a value:
Parameters can also be polymorphic: ContentId only accepts value, but value can be an integer (in which case the operator is Criterion\Operator::EQ or an array of ContentId using the Criterion\Operator::IN operator. In this case, the operator is silently selected depending on the input type.
The Criterion::getSpecifications() method indicates which operators are supported by the Criterion, and which input value is expected: Criterion\Specifications::FORMAT_SINGLE or Criterion\Specifications::FORMAT_ARRAY. Some specification entries also specify a type of value, for both single and array formats: Specifications::TYPE_INTEGER.
Some Criteria support a target. One example is datetime, that can apply to either the creation date, or the modification date (and should actually also apply to Date / DateTime Fields...).