Query
class Query extends Query
A Query is used to filter and order collections when making API requests.
Constants
DATE_FORMAT |
ISO8601 but with the seconds forced to 0. |
Methods
Returns the parameters to execute this query.
Sets the index of the first result to retrieve. To reset set to NULL.
Returns the index of the first result to retrieve. Can return NULL if no index is specified.
Set the maximum number of results to retrieve. To reset set to NULL;
Returns the maximum number of results to retrieve. Can return NULL if no maximum is defined.
Set the order of the items retrieved by this query.
Set the content type to which results should be limited. Set to NULL to not filter for a content type.
Returns the name of the content type for which results will be retrieved. Can be NULL if no content type is set
Add a filter condition to this query.
The select operator allows you to choose what to return from an entity.
Get the amount of levels of links that should be resolved.
Set the amount of levels of links that should be resolved.
Gets the locale for which content should be retrieved.
Sets the locale for which content should be retrieved. Set it to *
to retrieve all locales.
Details
in Query at line 79
__construct()
Query constructor.
Empty for now, included for forward compatibility.
at line 39
array
getQueryData()
Returns the parameters to execute this query.
in Query at line 138
string
getQueryString()
The urlencoded query string for this query.
in Query at line 154
$this
setSkip(int|null $skip)
Sets the index of the first result to retrieve. To reset set to NULL.
in Query at line 172
int|null
getSkip()
Returns the index of the first result to retrieve. Can return NULL if no index is specified.
in Query at line 188
$this
setLimit(int|null $limit)
Set the maximum number of results to retrieve. To reset set to NULL;
in Query at line 206
int|null
getLimit()
Returns the maximum number of results to retrieve. Can return NULL if no maximum is defined.
in Query at line 224
$this
orderBy(string|null $field, bool $reverse = false)
Set the order of the items retrieved by this query.
Note that when ordering Entries by fields you must set the content_type URI query parameter to the ID of the Content Type you want to filter by. Can be called multiple times to order by multiple values.
in Query at line 245
$this
setContentType(ContentType|string|null $contentType)
Set the content type to which results should be limited. Set to NULL to not filter for a content type.
Only works when querying entries.
in Query at line 263
string|null
getContentType()
Returns the name of the content type for which results will be retrieved. Can be NULL if no content type is set
in Query at line 277
$this
setMimeTypeGroup(string|null $group)
in Query at line 305
null|string
getMimeTypeGroup()
in Query at line 337
$this
where(string $field, string|array|DateTimeInterface|Location $value, string|null $operator = null)
Add a filter condition to this query.
Valid operators are - ne - all - in - nin - exists - lt - lte - gt - gte - match - near - within
in Query at line 388
$this
select(array $select)
The select operator allows you to choose what to return from an entity.
You provide one or multiple JSON paths and the API will return the properties at those paths.
To only request the metadata simply query for 'sys'.
at line 59
int|null
getInclude()
Get the amount of levels of links that should be resolved.
at line 73
$this
setInclude(int|null $include)
Set the amount of levels of links that should be resolved.
at line 87
string|null
getLocale()
Gets the locale for which content should be retrieved.
at line 101
$this
setLocale(string|null $locale)
Sets the locale for which content should be retrieved. Set it to *
to retrieve all locales.