Google\Cloud\Datastore\DatastoreClient::keys PHP Method

keys() public method

When inserting multiple entities, creating a set of keys at once can be useful. By defining the Key's kind and any ancestors up front, and allowing Cloud Datastore to allocate IDs, you can be sure that your entity identity and ancestry are correct and that there will be no collisions during the insert operation. Example: $keys = $datastore->keys('Person', [ 'number' => 10 ]); Ancestor paths can be specified $keys = $datastore->keys('Person', [ 'ancestors' => [ ['kind' => 'Person', 'name' => 'Grandpa Joe'], ['kind' => 'Person', 'name' => 'Dad Mike'] ], 'number' => 3 ]);
See also: https://cloud.google.com/datastore/reference/rest/v1/Key Key
See also: https://cloud.google.com/datastore/reference/rest/v1/Key#PathElement PathElement
public keys ( string $kind, array $options = [] ) : Key[]
$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 Key[]
    public function keys($kind, array $options = [])
    {
        return $this->operation->keys($kind, $options);
    }