Свойство | Type | Description | |
---|---|---|---|
$connection | Google\Cloud\Datastore\Connection\ConnectionInterface |
Méthode | Description | |
---|---|---|
__construct ( Google\Cloud\Datastore\Connection\ConnectionInterface $connection, string $projectId, string $namespaceId, |
Create an operation | |
allocateIds ( array $keys, array $options = [] ) : |
Allocate available IDs to a set of keys | |
allocateIdsToEntities ( array $entities ) : |
Patch any incomplete keys in the given array of entities | |
checkOverwrite ( array $entities, boolean $allowOverwrite = false ) : void | Check whether an update or upsert operation may proceed safely | |
commit ( array $mutations, array $options = [] ) : array | Commit all mutations | |
entity ( |
Create an entity | |
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 ( array $keys, array $options = [] ) : array | Lookup records by key | |
mutation ( string $operation, |
Enqueue a mutation | |
rollback ( string $transactionId ) : void | Roll back a transaction | |
runQuery ( Google\Cloud\Datastore\Query\QueryInterface $query, array $options = [] ) : Generator |
Run a query and return entities |
Méthode | Description | |
---|---|---|
mapEntityResult ( array $entityResult, string | array $class ) : |
Convert an EntityResult into an array of entities | |
readOptions ( array $options = [] ) : array | Format the readOptions | |
sortEntities ( array $entities, array $keys ) : |
Sort entities into the order given in $keys. |
public __construct ( Google\Cloud\Datastore\Connection\ConnectionInterface $connection, string $projectId, string $namespaceId, |
||
$connection | Google\Cloud\Datastore\Connection\ConnectionInterface | A connection to Google Cloud Platform's Datastore API. |
$projectId | string | The Google Cloud Platform project ID. |
$namespaceId | string | The namespace to use for all service requests. |
$entityMapper |
public allocateIds ( array $keys, array $options = [] ) : |
||
$keys | array | The incomplete keys. |
$options | array | [optional] Configuration Options. |
Résultat |
public allocateIdsToEntities ( array $entities ) : |
||
$entities | array | A list of entities |
Résultat |
public commit ( array $mutations, array $options = [] ) : array | ||
$mutations | array | [Mutation[]](https://cloud.google.com/datastore/docs/reference/rest/v1/projects/commit#Mutation). |
$options | array | [optional] { Configuration Options @type string $transaction The transaction ID, if the query should be run in a transaction. } |
Résultat | 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. } |
Résultat |
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`. } |
Résultat |
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. } |
Résultat |
public lookup ( array $keys, array $options = [] ) : array | ||
$keys | array | The identifiers to look up. |
$options | array | [optional] { Configuration Options @type string $readConsistency See [ReadConsistency](https://cloud.google.com/datastore/reference/rest/v1/ReadOptions#ReadConsistency). @type string $transaction The transaction ID, if the query should be run in a transaction. @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`. } |
Résultat | 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 mutation ( string $operation, |
||
$operation | string | The operation to execute. "Insert", "Upsert", "Update" or "Delete". |
$input | The entity or key to mutate. | |
$type | string | The type of the input array. |
$baseVersion | string | [optional] 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. |
Résultat | array | [Mutation](https://cloud.google.com/datastore/docs/reference/rest/v1/projects/commit#Mutation). |
public runQuery ( Google\Cloud\Datastore\Query\QueryInterface $query, array $options = [] ) : Generator |
||
$query | Google\Cloud\Datastore\Query\QueryInterface | The query object. |
$options | array | [optional] { Configuration Options @type string $transaction The transaction ID, if the query should be run in a transaction. @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). } |
Résultat | Generator |