class BaseQuery

BaseQuery class.

A BaseQuery is used to filter and order collections when making API requests.

Constants

DATE_FORMAT

ISO8601 but with the seconds forced to 0.

Properties

static protected string[] $validOperators
static protected string[] $validGroups

Methods

getQueryData()

Returns the parameters to execute this query.

getQueryString()

The urlencoded query string for this query.

$this
setSkip(int $skip = null)

Sets the index of the first result to retrieve. To reset set to NULL.

$this
setLimit(int $limit = null)

Set the maximum number of results to retrieve. To reset set to NULL;.

$this
orderBy(string $field, bool $reverse = false)

Set the order of the items retrieved by this query.

$this
setContentType(string $contentType = null)

Set the content type to which results should be limited. Set to NULL to not filter for a content type.

$this
setMimeTypeGroup(string $group = null)

No description

$this
where(string $field, $value)

Add a filter condition to this query.

$this
select(array $select)

The select operator allows you to choose what to return from an entity.

$this
linksToEntry(string $entryId)

Filters for all entries that link to an entry.

$this
linksToAsset(string $assetId)

Filters for all entries that link to an asset.

Details

at line 130
getQueryData()

Returns the parameters to execute this query.

at line 147
getQueryString()

The urlencoded query string for this query.

at line 161
$this setSkip(int $skip = null)

Sets the index of the first result to retrieve. To reset set to NULL.

Parameters

int $skip The index of the first result that will be retrieved. Must be >= 0.

Return Value

$this

Exceptions

RangeException If $skip is not within the specified range

at line 181
$this setLimit(int $limit = null)

Set the maximum number of results to retrieve. To reset set to NULL;.

Parameters

int $limit The maximum number of results to retrieve, must be between 1 and 1000 or null

Return Value

$this

Exceptions

RangeException If $maxArguments is not withing the specified range

at line 200
$this orderBy(string $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.

Parameters

string $field
bool $reverse

Return Value

$this

at line 218
$this setContentType(string $contentType = null)

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.

Parameters

string $contentType

Return Value

$this

at line 230
$this setMimeTypeGroup(string $group = null)

Parameters

string $group

Return Value

$this

Exceptions

InvalidArgumentException if $group is not a valid value

at line 250
$this where(string $field, $value)

Add a filter condition to this query.

Parameters

string $field
$value

Return Value

$this

Exceptions

InvalidArgumentException If $operator is not one of the valid values

at line 288
$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'.

Parameters

array $select

Return Value

$this

at line 305
$this linksToEntry(string $entryId)

Filters for all entries that link to an entry.

Parameters

string $entryId

Return Value

$this

at line 317
$this linksToAsset(string $assetId)

Filters for all entries that link to an asset.

Parameters

string $assetId

Return Value

$this