Datastore/src/Operation.php
public function commit(array $mutations, array $options = [])
    {
        $options += [
            'transaction' => null
        ];

        $res = $this->connection->commit($options + [
            'mode' => ($options['transaction']) ? 'TRANSACTIONAL' : 'NON_TRANSACTIONAL',
            'mutations' => $mutations,
            'projectId' => $this->projectId
        ]);

        return $res;
    }
public function commit(array $mutations, array $options = [])
    {
        $options += [
            'transaction' => null
        ];

        $res = $this->connection->commit($options + [
            'mode' => ($options['transaction']) ? 'TRANSACTIONAL' : 'NON_TRANSACTIONAL',
            'mutations' => $mutations,
            'projectId' => $this->projectId
        ]);

        return $res;
    }
public function commit ( array $ mutations , array $ options = [ ] ) { $ options += [ 'transaction' => null ] ; $ res = $ this -> connection -> commit ( $ options + [ 'mode' => ( $ options [ 'transaction' ] ) ? 'TRANSACTIONAL' : 'NON_TRANSACTIONAL' , 'mutations' => $ mutations , 'projectId' => $ this -> projectId ] ) ; return $ res ; }
Commit all mutations

Calling this method will end the operation (and close the transaction,
if one is specified).

@codingStandardsIgnoreStart
@param array $mutations [Mutation[]](https://cloud.google.com/datastore/docs/reference/rest/v1/projects/commit#Mutation).
@param array $options [optional] {
Configuration Options

@type string $transaction The transaction ID, if the query should be
run in a transaction.
}
@return array [Response Body](https://cloud.google.com/datastore/reference/rest/v1/projects/commit#response-body)
@codingStandardsIgnoreEnd
Commit all mutations