Spanner/src/Operation.php
public function snapshot(Session $session, array $options = [])
    {
        $options += [
            'singleUse' => false,
            'className' => Snapshot::class
        ];

        if (!$options['singleUse']) {
            $res = $this->beginTransaction($session, $options);
        } else {
            $res = [];
        }

        $className = $this->pluck('className', $options);
        return $this->createSnapshot(
            $session,
            $res + $options,
            $className
        );
    }
public function snapshot(Session $session, array $options = [])
    {
        $options += [
            'singleUse' => false,
            'className' => Snapshot::class
        ];

        if (!$options['singleUse']) {
            $res = $this->beginTransaction($session, $options);
        } else {
            $res = [];
        }

        $className = $this->pluck('className', $options);
        return $this->createSnapshot(
            $session,
            $res + $options,
            $className
        );
    }
public function snapshot ( Session $ session , array $ options = [ ] ) { $ options += [ 'singleUse' => false , 'className' => Snapshot :: class ] ; if ( ! $ options [ 'singleUse' ] ) { $ res = $ this -> beginTransaction ( $ session , $ options ) ; } else { $ res = [ ] ; } $ className = $ this -> pluck ( 'className' , $ options ) ; return $ this -> createSnapshot ( $ session , $ res + $ options , $ className ) ; }
Create a read-only snapshot transaction.

@see https://cloud.google.com/spanner/reference/rpc/google.spanner.v1#google.spanner.v1.BeginTransactionRequest BeginTransactionRequest

@param Session $session The session to start the snapshot in.
@param array $options [optional] {
Configuration Options.

@type bool $singleUse If true, a Transaction ID will not be allocated
up front. Instead, the transaction will be considered
"single-use", and may be used for only a single operation.
**Defaults to** `false`.
@type string $className If set, an instance of the given class will
be instantiated. This setting is intended for internal use.
**Defaults to** `Google\Cloud\Spanner\Snapshot`.
}
@return Snapshot
Create a read - only snapshot transaction .