Reference documentation and code samples for the Cloud Datastore Client class EntityInterface.
Defines an interface for Datastore Entities.
This interface is fulfilled by EntityTrait , and it is recommended that classes implementing EntityInterface make use of that trait to ensure proper configuration.
Namespace
Google \ Cloud \ DatastoreMethods
get
Return all entity data as an array.
array
set
Set the entity body.
entity
array
The new entity body.
void
key
Return the Datastore key, or null if no key is present.
cursor
Fetch the cursor
This is only set when the entity was obtained from a query result. It can be used to manually paginate results.
string|null
baseVersion
Fetch the baseVersion
This is only set when the entity was obtained from a query result. It is used for concurrency control internally.
string|null
populatedByService
Indicate whether the entity was created as the result of an API call.
bool
setExcludeFromIndexes
A list of entity properties to exclude from datastore indexes.
properties
array
A list of properties to exclude from indexes.
void
excludedProperties
Return a list of properties excluded from datastore indexes.
array
meanings
Return a list of meaning values.
array
static::build
Create an instance of the entity class.
This factory method allows the implementor to define the means by which the key, entity data and entity options are managed within the entity implementation. This method is called by the Google Cloud PHP client to create entities.
key
entity
array
[optional] The entity body. Defaults to []
.
options
array
Configuration Options
↳ cursor
string
Set only when the entity is obtained by a query result. If set, the entity cursor can be retrieved from EntityInterface::cursor() .
↳ baseVersion
string
Set only when the entity is obtained by a query result. If set, the entity cursor can be retrieved from EntityInterface::baseVersion() .
↳ excludeFromIndexes
array
A list of entity keys to exclude from datastore indexes.
↳ meanings
array
A list of meaning values for entity properties.
↳ populatedByService
bool
Indicates whether the entity was created as the result of a service request.
static::mappings
Defines embedded entity mappings.
Embedded entities are converted to instances of Entity , or to associative arrays by default. By providing mappings, you can define the types to use in your application.
Types must implement EntityInterface .
array
Constants
EXCLUDE_FROM_INDEXES
Value: '___GOOGLECLOUDPHP___EXCLUDEFROMINDEXES___'

