Google\Cloud\Datastore\DatastoreClient::keys PHP 메소드

keys() 공개 메소드

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 ]);
또한 보기: https://cloud.google.com/datastore/reference/rest/v1/Key Key
또한 보기: 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. }
리턴 Key[]
    public function keys($kind, array $options = [])
    {
        return $this->operation->keys($kind, $options);
    }