Cloud Datastore V1 Client - Class Query (1.18.1)

Reference documentation and code samples for the Cloud Datastore V1 Client class Query.

A query for entities.

Generated from protobuf message google.datastore.v1.Query

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ projection array<Google\Cloud\Datastore\V1\Projection>

The projection to return. Defaults to returning all properties.

↳ kind array<Google\Cloud\Datastore\V1\KindExpression>

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

↳ filter Google\Cloud\Datastore\V1\Filter

The filter to apply.

↳ order array<Google\Cloud\Datastore\V1\PropertyOrder>

The order to apply to the query results (if empty, order is unspecified).

↳ distinct_on array<Google\Cloud\Datastore\V1\PropertyReference>

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

↳ start_cursor string

A starting point for the query results. Query cursors are returned in query result batches and can only be used to continue the same query.

↳ end_cursor string

An ending point for the query results. Query cursors are returned in query result batches and can only be used to limit the same query.

↳ offset int

The number of results to skip. Applies before limit, but after all other constraints. Optional. Must be >= 0 if specified.

↳ limit Google\Protobuf\Int32Value

The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.

getProjection

The projection to return. Defaults to returning all properties.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setProjection

The projection to return. Defaults to returning all properties.

Parameter
NameDescription
var array<Google\Cloud\Datastore\V1\Projection>
Returns
TypeDescription
$this

getKind

The kinds to query (if empty, returns entities of all kinds).

Currently at most 1 kind may be specified.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setKind

The kinds to query (if empty, returns entities of all kinds).

Currently at most 1 kind may be specified.

Parameter
NameDescription
var array<Google\Cloud\Datastore\V1\KindExpression>
Returns
TypeDescription
$this

getFilter

The filter to apply.

Returns
TypeDescription
Google\Cloud\Datastore\V1\Filter|null

hasFilter

clearFilter

setFilter

The filter to apply.

Parameter
NameDescription
var Google\Cloud\Datastore\V1\Filter
Returns
TypeDescription
$this

getOrder

The order to apply to the query results (if empty, order is unspecified).

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setOrder

The order to apply to the query results (if empty, order is unspecified).

Parameter
NameDescription
var array<Google\Cloud\Datastore\V1\PropertyOrder>
Returns
TypeDescription
$this

getDistinctOn

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setDistinctOn

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Parameter
NameDescription
var array<Google\Cloud\Datastore\V1\PropertyReference>
Returns
TypeDescription
$this

getStartCursor

A starting point for the query results. Query cursors are returned in query result batches and can only be used to continue the same query.

Returns
TypeDescription
string

setStartCursor

A starting point for the query results. Query cursors are returned in query result batches and can only be used to continue the same query.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getEndCursor

An ending point for the query results. Query cursors are returned in query result batches and can only be used to limit the same query.

Returns
TypeDescription
string

setEndCursor

An ending point for the query results. Query cursors are returned in query result batches and can only be used to limit the same query.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getOffset

The number of results to skip. Applies before limit, but after all other constraints. Optional. Must be >= 0 if specified.

Returns
TypeDescription
int

setOffset

The number of results to skip. Applies before limit, but after all other constraints. Optional. Must be >= 0 if specified.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getLimit

The maximum number of results to return. Applies after all other constraints. Optional.

Unspecified is interpreted as no limit. Must be >= 0 if specified.

Returns
TypeDescription
Google\Protobuf\Int32Value|null

hasLimit

clearLimit

getLimitValue

Returns the unboxed value from getLimit()

The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.

Returns
TypeDescription
int|null

setLimit

The maximum number of results to return. Applies after all other constraints. Optional.

Unspecified is interpreted as no limit. Must be >= 0 if specified.

Parameter
NameDescription
var Google\Protobuf\Int32Value
Returns
TypeDescription
$this

setLimitValue

Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object.

The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.

Parameter
NameDescription
var int|null
Returns
TypeDescription
$this