Spanner/src/TransactionConfigurationTrait.php
private function transactionSelector(array &$options, array $previous = [])
    {
        $options += [
            'begin' => false,
            'transactionType' => SessionPoolInterface::CONTEXT_READ,
        ];

        $res = $this->transactionOptions($options, $previous);

        // TransactionSelector uses a different key name for singleUseTransaction
        // and transactionId than transactionOptions, so we'll rewrite those here
        // so transactionOptions works as expected for commitRequest.

        $type = $res[1];
        if ($type === 'singleUseTransaction') {
            $type = 'singleUse';
        } elseif ($type === 'transactionId') {
            $type = 'id';
        }

        return [
            [$type => $res[0]],
            $res[2]
        ];
    }
private function transactionSelector(array &$options, array $previous = [])
    {
        $options += [
            'begin' => false,
            'transactionType' => SessionPoolInterface::CONTEXT_READ,
        ];

        $res = $this->transactionOptions($options, $previous);

        // TransactionSelector uses a different key name for singleUseTransaction
        // and transactionId than transactionOptions, so we'll rewrite those here
        // so transactionOptions works as expected for commitRequest.

        $type = $res[1];
        if ($type === 'singleUseTransaction') {
            $type = 'singleUse';
        } elseif ($type === 'transactionId') {
            $type = 'id';
        }

        return [
            [$type => $res[0]],
            $res[2]
        ];
    }
private function transactionSelector ( array & $ options , array $ previous = [ ] ) { $ options += [ 'begin' => false , 'transactionType' => SessionPoolInterface :: CONTEXT_READ , ] ; $ res = $ this -> transactionOptions ( $ options , $ previous ) ; // TransactionSelector uses a different key name for singleUseTransaction // and transactionId than transactionOptions, so we'll rewrite those here // so transactionOptions works as expected for commitRequest. $ type = $ res [ 1 ] ; if ( $ type === 'singleUseTransaction' ) { $ type = 'singleUse' ; } elseif ( $ type === 'transactionId' ) { $ type = 'id' ; } return [ [ $ type => $ res [ 0 ] ] , $ res [ 2 ] ] ; }
Format a transaction from read or execute.

Depending on given options, can be singleUse or begin, and can be read
or read/write.

@param array $options call options.
@param array $previous Previously given call options (for single-use snapshots).
@return array [(array) transaction selector, (string) context]
Format a transaction from read or execute .