Google\Cloud\Datastore\Transaction::update PHP Method

update() public method

No service requests are run when this method is called. Use {@see \Google\Cloud\Datastore\Transaction::commit()} to commit changes. Example: $entity['firstName'] = 'Bob'; $transaction->update($entity); $transaction->commit();
public update ( Entity $entity, array $options = [] ) : Transaction
$entity Entity The entity to update.
$options array [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 Transaction
    public function update(Entity $entity, array $options = [])
    {
        $options += ['allowOverwrite' => false];
        return $this->updateBatch([$entity], $options);
    }