Google\Cloud\Datastore\DatastoreClient::deleteBatch PHP Метод

deleteBatch() публичный Метод

Deletion by this method is non-transactional. If you need transaction support, use {@see \Google\Cloud\Datastore\Transaction::deleteBatch()}. Example: $keys = [ $datastore->key('Person', 'Bob'), $datastore->key('Person', 'John') ]; $datastore->deleteBatch($keys);
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. }
Результат array [Response Body](https://cloud.google.com/datastore/reference/rest/v1/projects/commit#response-body)
    public function deleteBatch(array $keys, array $options = [])
    {
        $options += ['baseVersion' => null];
        $mutations = [];
        foreach ($keys as $key) {
            $mutations[] = $this->operation->mutation('delete', $key, Key::class, $options['baseVersion']);
        }
        return $this->operation->commit($mutations, $options);
    }