Datastore/src/DatastoreClient.php
public function update(EntityInterface $entity, array $options = [])
    {
        $res = $this->updateBatch([$entity], $options);
        return $this->parseSingleMutationResult($res);
    }
public function update(EntityInterface $entity, array $options = [])
    {
        $res = $this->updateBatch([$entity], $options);
        return $this->parseSingleMutationResult($res);
    }
public function update ( EntityInterface $ entity , array $ options = [ ] ) { $ res = $ this -> updateBatch ( [ $ entity ] , $ options ) ; return $ this -> parseSingleMutationResult ( $ res ) ; }
Update an entity

Please note that updating a record in Cloud Datastore will replace the
existing record. Adding, editing or removing a single property is only
possible by first retrieving the entire entity in its existing state.

Update by this method is non-transactional. If you need transaction
support, use {@see Google\Cloud\Datastore\Transaction::update()}.

Example:
```
$entity['firstName'] = 'John';

$datastore->update($entity);
```

@see https://cloud.google.com/datastore/docs/reference/rest/v1/projects/commit Commit API documentation

@param EntityInterface $entity The entity to be updated.
@param array $options [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.
@throws DomainException If a conflict occurs, fail.
Update an entity