Firestore/src/WriteBatch.php
public function commit(array $options = [])
    {
        unset($options['merge'], $options['precondition']);

        $response = $this->connection->commit(array_filter([
            'database' => $this->database,
            'writes' => $this->writes,
            'transaction' => $this->transaction
        ]) + $options);

        if (isset($response['commitTime'])) {
            $time = $this->parseTimeString($response['commitTime']);
            $response['commitTime'] = new Timestamp($time[0], $time[1]);
        }

        if (isset($response['writeResults'])) {
            foreach ($response['writeResults'] as &$result) {
                if (isset($result['updateTime'])) {
                    $time = $this->parseTimeString($result['updateTime']);
                    $result['updateTime'] = new Timestamp($time[0], $time[1]);
                }
            }
        }

        return $response;
    }
public function commit(array $options = [])
    {
        unset($options['merge'], $options['precondition']);

        $response = $this->connection->commit(array_filter([
            'database' => $this->database,
            'writes' => $this->writes,
            'transaction' => $this->transaction
        ]) + $options);

        if (isset($response['commitTime'])) {
            $time = $this->parseTimeString($response['commitTime']);
            $response['commitTime'] = new Timestamp($time[0], $time[1]);
        }

        if (isset($response['writeResults'])) {
            foreach ($response['writeResults'] as &$result) {
                if (isset($result['updateTime'])) {
                    $time = $this->parseTimeString($result['updateTime']);
                    $result['updateTime'] = new Timestamp($time[0], $time[1]);
                }
            }
        }

        return $response;
    }
public function commit ( array $ options = [ ] ) { unset ( $ options [ 'merge' ] , $ options [ 'precondition' ] ) ; $ response = $ this -> connection -> commit ( array_filter ( [ 'database' => $ this -> database , 'writes' => $ this -> writes , 'transaction' => $ this -> transaction ] ) + $ options ) ; if ( isset ( $ response [ 'commitTime' ] ) ) { $ time = $ this -> parseTimeString ( $ response [ 'commitTime' ] ) ; $ response [ 'commitTime' ] = new Timestamp ( $ time [ 0 ] , $ time [ 1 ] ) ; } if ( isset ( $ response [ 'writeResults' ] ) ) { foreach ( $ response [ 'writeResults' ] as & $ result ) { if ( isset ( $ result [ 'updateTime' ] ) ) { $ time = $ this -> parseTimeString ( $ result [ 'updateTime' ] ) ; $ result [ 'updateTime' ] = new Timestamp ( $ time [ 0 ] , $ time [ 1 ] ) ; } } } return $ response ; }
Commit writes to the database.

Example:
```
$batch->commit();
```

@codingStandardsIgnoreStart
@see https://firebase.google.com/docs/firestore/reference/rpc/google.firestore.v1beta1#google.firestore.v1beta1.Firestore.Commit Commit

@param array $options Configuration Options
@return array [https://firebase.google.com/docs/firestore/reference/rpc/google.firestore.v1beta1#commitresponse](CommitResponse)
@codingStandardsIgnoreEnd
Commit writes to the database .