Cloud Datastore V1 Client - Class TransactionOptions (1.22.1)

Reference documentation and code samples for the Cloud Datastore V1 Client class TransactionOptions.

Options for beginning a new transaction.

Transactions can be created explicitly with calls to Datastore.BeginTransaction or implicitly by setting ReadOptions.new_transaction in read requests.

Generated from protobuf message google.datastore.v1.TransactionOptions

Namespace

Google \ Cloud \ Datastore \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ read_write Google\Cloud\Datastore\V1\TransactionOptions\ReadWrite

The transaction should allow both reads and writes.

↳ read_only Google\Cloud\Datastore\V1\TransactionOptions\PBReadOnly

The transaction should only allow reads.

getReadWrite

The transaction should allow both reads and writes.

Returns
TypeDescription
Google\Cloud\Datastore\V1\TransactionOptions\ReadWrite|null

hasReadWrite

setReadWrite

The transaction should allow both reads and writes.

Parameter
NameDescription
var Google\Cloud\Datastore\V1\TransactionOptions\ReadWrite
Returns
TypeDescription
$this

getReadOnly

The transaction should only allow reads.

Returns
TypeDescription
Google\Cloud\Datastore\V1\TransactionOptions\PBReadOnly|null

hasReadOnly

setReadOnly

The transaction should only allow reads.

Parameter
NameDescription
var Google\Cloud\Datastore\V1\TransactionOptions\PBReadOnly
Returns
TypeDescription
$this

getMode

Returns
TypeDescription
string