Cloud Datastore V1 Client - Class EntityResult (2.0.3)

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

The result of fetching an entity from Datastore.

Generated from protobuf messagegoogle.datastore.v1.EntityResult

Namespace

Google \ Cloud \ Datastore \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
dataarray

Optional. Data for populating the Message object.

↳ entityEntity

The resulting entity.

↳ versionint|string

The version of the entity, a strictly positive number that monotonically increases with changes to the entity. This field is set forFULL entity results. Formissing entities inLookupResponse, this is the version of the snapshot that was used to look up the entity, and it is always set except for eventually consistent reads.

↳ create_timeGoogle\Protobuf\Timestamp

The time at which the entity was created. This field is set forFULL entity results. If this entity is missing, this field will not be set.

↳ update_timeGoogle\Protobuf\Timestamp

The time at which the entity was last changed. This field is set forFULL entity results. If this entity is missing, this field will not be set.

↳ cursorstring

A cursor that points to the position after the result entity. Set only when theEntityResult is part of aQueryResultBatch message.

getEntity

The resulting entity.

Returns
TypeDescription
Entity|null

hasEntity

clearEntity

setEntity

The resulting entity.

Parameter
NameDescription
varEntity
Returns
TypeDescription
$this

getVersion

The version of the entity, a strictly positive number that monotonicallyincreases with changes to the entity.

This field is set forFULL entity results.Formissing entities inLookupResponse, this is the version of the snapshot that was used to lookup the entity, and it is always set except for eventually consistent reads.

Returns
TypeDescription
int|string

setVersion

The version of the entity, a strictly positive number that monotonicallyincreases with changes to the entity.

This field is set forFULL entity results.Formissing entities inLookupResponse, this is the version of the snapshot that was used to lookup the entity, and it is always set except for eventually consistent reads.

Parameter
NameDescription
varint|string
Returns
TypeDescription
$this

getCreateTime

The time at which the entity was created.

This field is set forFULL entity results.If this entity is missing, this field will not be set.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasCreateTime

clearCreateTime

setCreateTime

The time at which the entity was created.

This field is set forFULL entity results.If this entity is missing, this field will not be set.

Parameter
NameDescription
varGoogle\Protobuf\Timestamp
Returns
TypeDescription
$this

getUpdateTime

The time at which the entity was last changed.

This field is set forFULL entity results.If this entity is missing, this field will not be set.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasUpdateTime

clearUpdateTime

setUpdateTime

The time at which the entity was last changed.

This field is set forFULL entity results.If this entity is missing, this field will not be set.

Parameter
NameDescription
varGoogle\Protobuf\Timestamp
Returns
TypeDescription
$this

getCursor

A cursor that points to the position after the result entity.

Set only when theEntityResult is part of aQueryResultBatch message.

Returns
TypeDescription
string

setCursor

A cursor that points to the position after the result entity.

Set only when theEntityResult is part of aQueryResultBatch message.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-01-24 UTC.