Property | Type | Description | |
---|---|---|---|
$connection | ConnectionInterface | ||
$operation |
Method | Description | |
---|---|---|
__construct ( array $config = [] ) | Create a Datastore client. | |
allocateId ( |
Allocates an available ID to a given incomplete key | |
allocateIds ( array $keys, array $options = [] ) : |
Allocate available IDs to a set of keys | |
blob ( string | resource | StreamInterface $value ) : |
Create a new Blob | |
delete ( |
Delete an entity | |
deleteBatch ( array $keys, array $options = [] ) : array | Delete multiple entities | |
entity ( |
Create an entity. | |
geoPoint ( float $latitude, float $longitude ) : |
Create a new GeoPoint | |
gqlQuery ( string $query, array $options = [] ) : |
Create a GqlQuery | |
insert ( |
Insert an entity | |
insertBatch ( array $entities, array $options = [] ) : array | Insert multiple entities | |
int64 ( string $value ) : |
Create an Int64 object. This can be used to work with 64 bit integers as a string value while on a 32 bit platform. | |
key ( string $kind, string | integer $identifier = null, array $options = [] ) : |
Create a single Key instance | |
keys ( string $kind, array $options = [] ) : |
Create multiple keys with the same configuration. | |
lookup ( |
Retrieve an entity from the datastore | |
lookupBatch ( array $keys, array $options = [] ) : array | Get multiple entities | |
query ( array $query = [] ) : |
Create a Query | |
runQuery ( Google\Cloud\Datastore\Query\QueryInterface $query, array $options = [] ) : Generator |
Run a query and return entities | |
transaction ( array $options = [] ) : |
Create a Transaction | |
update ( |
Update an entity | |
updateBatch ( array $entities, array $options = [] ) : array | Update multiple entities | |
upsert ( |
Upsert an entity | |
upsertBatch ( array $entities, array $options = [] ) : array | Upsert multiple entities |
Method | Description | |
---|---|---|
parseSingleMutationResult ( array $res ) : string | Handle mutation results |
public __construct ( array $config = [] ) | ||
$config | array | [optional] { Configuration Options. @type string $projectId The project ID from the Google Developer's Console. @type CacheItemPoolInterface $authCache A cache for storing access tokens. **Defaults to** a simple in memory implementation. @type array $authCacheOptions Cache configuration options. @type callable $authHttpHandler A handler used to deliver Psr7 requests specifically for authentication. @type callable $httpHandler A handler used to deliver Psr7 requests. Only valid for requests sent over REST. @type string $keyFile The contents of the service account credentials .json file retrieved from the Google Developers Console. @type string $keyFilePath The full path to your service account credentials .json file retrieved from the Google Developers Console. @type int $retries Number of retries for a failed request. **Defaults to** `3`. @type array $scopes Scopes to be used for the request. @type string $namespaceId Partitions data under a namespace. Useful for [Multitenant Projects](https://cloud.google.com/datastore/docs/concepts/multitenancy). @type bool $returnInt64AsObject If true, 64 bit integers will be returned as a {@see \Google\Cloud\Int64} object for 32 bit platform compatibility. **Defaults to** false. } |
public allocateId ( |
||
$key | The incomplete key. | |
$options | array | [optional] Configuration options. |
return |
public allocateIds ( array $keys, array $options = [] ) : |
||
$keys | array | The incomplete keys. |
$options | array | [optional] Configuration options. |
return |
public delete ( |
||
$key | The identifier to delete. | |
$options | array | [optional] { Configuration options @type string $baseVersion Provides concurrency control. The version of the entity that this mutation is being applied to. If this does not match the current version on the server, the mutation conflicts. } |
return | string | The updated entity version number. |
public deleteBatch ( array $keys, array $options = [] ) : array | ||
$keys | array | The identifiers to delete. |
$options | array | [optional] { Configuration options @type string $baseVersion Provides concurrency control. The version of the entity that this mutation is being applied to. If this does not match the current version on the server, the mutation conflicts. } |
return | array | [Response Body](https://cloud.google.com/datastore/reference/rest/v1/projects/commit#response-body) |
public entity ( |
||
$key | The key used to identify the record, or a string $kind. | |
$entity | array | [optional] The data to fill the entity with. |
$options | array | [optional] { Configuration Options @type string $className The name of a class extending {@see \Google\Cloud\Datastore\Entity}. If provided, an instance of that class will be returned instead of Entity. If not set, {@see \Google\Cloud\Datastore\Entity} will be used. @type array $excludeFromIndexes A list of entity keys to exclude from datastore indexes. } |
return |
public gqlQuery ( string $query, array $options = [] ) : |
||
$query | string | The [GQL Query](https://cloud.google.com/datastore/docs/apis/gql/gql_reference) string. |
$options | array | [optional] { Configuration Options @type bool $allowLiterals Whether literal values will be allowed in the query string. Parameter binding is strongly encouraged over literals. **Defaults to** `false`. @type array $bindings An array of values to bind to the query string. Queries using Named Bindings should provide a key/value set, while queries using Positional Bindings must provide a simple array. @type string $readConsistency See [ReadConsistency](https://cloud.google.com/datastore/reference/rest/v1/ReadOptions#ReadConsistency). } |
return |
public key ( string $kind, string | integer $identifier = null, array $options = [] ) : |
||
$kind | string | The kind. |
$identifier | string | integer | [optional] The ID or name. |
$options | array | [optional] { Configuration Options @type string $identifierType If omitted, type will be determined internally. In cases where any ambiguity can be expected (i.e. if you want to create keys with `name` but your values may pass PHP's `is_numeric()` check), this value may be explicitly set using `Key::TYPE_ID` or `Key::TYPE_NAME`. } |
return |
public keys ( string $kind, array $options = [] ) : |
||
$kind | string | The kind to use in the final path element. |
$options | array | [optional] { Configuration Options @type array[] $ancestors An array of [PathElement](https://cloud.google.com/datastore/reference/rest/v1/Key#PathElement) arrays. Use to create [ancestor paths](https://cloud.google.com/datastore/docs/concepts/entities#ancestor_paths). @type int $number The number of keys to generate. @type string|int $id The ID for the last pathElement. @type string $name The Name for the last pathElement. } |
return |
public lookup ( |
||
$key | The identifier to use to locate a desired entity. | |
$options | array | [optional] { Configuration Options @type string $readConsistency See [ReadConsistency](https://cloud.google.com/datastore/reference/rest/v1/ReadOptions#ReadConsistency). @type string $className The name of the class to return results as. Must be a subclass of {@see \Google\Cloud\Datastore\Entity}. If not set, {@see \Google\Cloud\Datastore\Entity} will be used. } |
return |
public lookupBatch ( array $keys, array $options = [] ) : array | ||
$keys | array | |
$options | array | [optional] { Configuration Options @type string $readConsistency See [ReadConsistency](https://cloud.google.com/datastore/reference/rest/v1/ReadOptions#ReadConsistency). @type string|array $className If a string, the name of the class to return results as. Must be a subclass of {@see \Google\Cloud\Datastore\Entity}. If not set, {@see \Google\Cloud\Datastore\Entity} will be used. If an array is given, it must be an associative array, where the key is a Kind and the value is the name of a subclass of {@see \Google\Cloud\Datastore\Entity}. @type bool $sort If set to true, results in each set will be sorted to match the order given in $keys. **Defaults to** `false`. } |
return | array | Returns an array with keys [`found`, `missing`, and `deferred`]. Members of `found` will be instance of {@see \Google\Cloud\Datastore\Entity}. Members of `missing` and `deferred` will be instance of {@see \Google\Cloud\Datastore\Key}. |
public runQuery ( Google\Cloud\Datastore\Query\QueryInterface $query, array $options = [] ) : Generator |
||
$query | Google\Cloud\Datastore\Query\QueryInterface | A query object. |
$options | array | [optional] { Configuration Options @type string $className The name of the class to return results as. Must be a subclass of {@see \Google\Cloud\Datastore\Entity}. If not set, {@see \Google\Cloud\Datastore\Entity} will be used. @type string $readConsistency See [ReadConsistency](https://cloud.google.com/datastore/reference/rest/v1/ReadOptions#ReadConsistency). } |
return | Generator |
public transaction ( array $options = [] ) : |
||
$options | array | [optional] Configuration options. |
return |
public update ( |
||
$entity | The entity to be updated. | |
$options | array | [optional] { Configuration Options @type bool $allowOverwrite Entities must be updated as an entire resource. Patch operations are not supported. Because entities can be created manually, or obtained by a lookup or query, it is possible to accidentally overwrite an existing record with a new one when manually creating an entity. To provide additional safety, this flag must be set to `true` in order to update a record when the entity provided was not obtained through a lookup or query. **Defaults to** `false`. } |
return | string | The entity version. |
public updateBatch ( array $entities, array $options = [] ) : array | ||
$entities | array | The entities to be updated. |
$options | array | [optional] { Configuration Options @type bool $allowOverwrite Entities must be updated as an entire resource. Patch operations are not supported. Because entities can be created manually, or obtained by a lookup or query, it is possible to accidentally overwrite an existing record with a new one when manually creating an entity. To provide additional safety, this flag must be set to `true` in order to update a record when the entity provided was not obtained through a lookup or query. **Defaults to** `false`. } |
return | array | [Response Body](https://cloud.google.com/datastore/reference/rest/v1/projects/commit#response-body) |
protected ConnectionInterface $connection | ||
return | ConnectionInterface |