Datastore/src/DatastoreClient.php
public function readOnlyTransaction(array $options = [])
    {
        $transaction = $this->operation->beginTransaction([
            // if empty, force request to encode as {} rather than [].
            'readOnly' => $this->pluck('transactionOptions', $options, false) ?: (object) []
        ], $options);

        return new ReadOnlyTransaction(
            $this->operation,
            $this->projectId,
            $transaction
        );
    }
public function readOnlyTransaction(array $options = [])
    {
        $transaction = $this->operation->beginTransaction([
            // if empty, force request to encode as {} rather than [].
            'readOnly' => $this->pluck('transactionOptions', $options, false) ?: (object) []
        ], $options);

        return new ReadOnlyTransaction(
            $this->operation,
            $this->projectId,
            $transaction
        );
    }
public function readOnlyTransaction ( array $ options = [ ] ) { $ transaction = $ this -> operation -> beginTransaction ( [ // if empty, force request to encode as {} rather than []. 'readOnly' => $ this -> pluck ( 'transactionOptions' , $ options , false ) ? : ( object ) [ ] ] , $ options ) ; return new ReadOnlyTransaction ( $ this -> operation , $ this -> projectId , $ transaction ) ; }
Create a Read-Only Transaction.

Example:
```
$transaction = $datastore->readOnlyTransaction();
```

@see https://cloud.google.com/datastore/docs/concepts/transactions Datastore Transactions
@see https://cloud.google.com/datastore/docs/reference/rest/v1/projects/beginTransaction beginTransaction

@codingStandardsIgnoreStart
@param array $options {
Configuration options.

@type array $transactionOptions See
[ReadOnly](https://cloud.google.com/datastore/docs/reference/rest/v1/projects/beginTransaction#ReadOnly).
}
@return ReadOnlyTransaction
@codingStandardsIgnoreEnd
Create a Read - Only Transaction .