2.2.0 (latest) 2.0.6 1.34.2 1.33.1 1.32.3 1.31.0 1.30.0 1.29.2 1.28.2 1.26.0 1.25.0 1.24.4 1.23.0 1.22.1 1.21.2 1.19.0 1.18.1 1.17.1 Reference documentation and code samples for the Cloud Datastore V1 Client class ReadOptions.

The options shared by read requests.

Generated from protobuf message `google.datastore.v1.ReadOptions`

## Namespace

Google \\ Cloud \\ Datastore \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ read_consistency` | `int` The non-transactional read consistency to use. |
| `↳ transaction` | `string` The identifier of the transaction in which to read. A transaction identifier is returned by a call to [Datastore.BeginTransaction](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.Client.DatastoreClient#_Google_Cloud_Datastore_V1_Client_DatastoreClient__beginTransaction__). |
| `↳ new_transaction` | `https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.TransactionOptions` Options for beginning a new transaction for this request. The new transaction identifier will be returned in the corresponding response as either [LookupResponse.transaction](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.LookupResponse#_Google_Cloud_Datastore_V1_LookupResponse__getTransaction__) or [RunQueryResponse.transaction](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunQueryResponse#_Google_Cloud_Datastore_V1_RunQueryResponse__getTransaction__). |
| `↳ read_time` | `Google\Protobuf\Timestamp` Reads entities as they were at the given time. This value is only supported for Cloud Firestore in Datastore mode. This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days. |

### getReadConsistency

The non-transactional read consistency to use.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ReadConsistency](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.ReadOptions.ReadConsistency). |

### hasReadConsistency

### setReadConsistency

The non-transactional read consistency to use.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [ReadConsistency](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.ReadOptions.ReadConsistency). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTransaction

The identifier of the transaction in which to read. A
transaction identifier is returned by a call to
[Datastore.BeginTransaction](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.Client.DatastoreClient#_Google_Cloud_Datastore_V1_Client_DatastoreClient__beginTransaction__).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasTransaction

### setTransaction

The identifier of the transaction in which to read. A
transaction identifier is returned by a call to
[Datastore.BeginTransaction](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.Client.DatastoreClient#_Google_Cloud_Datastore_V1_Client_DatastoreClient__beginTransaction__).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getNewTransaction

Options for beginning a new transaction for this request.

The new transaction identifier will be returned in the corresponding
response as either
[LookupResponse.transaction](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.LookupResponse#_Google_Cloud_Datastore_V1_LookupResponse__getTransaction__)
or
[RunQueryResponse.transaction](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunQueryResponse#_Google_Cloud_Datastore_V1_RunQueryResponse__getTransaction__).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.TransactionOptions|null` |   |

### hasNewTransaction

### setNewTransaction

Options for beginning a new transaction for this request.

The new transaction identifier will be returned in the corresponding
response as either
[LookupResponse.transaction](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.LookupResponse#_Google_Cloud_Datastore_V1_LookupResponse__getTransaction__)
or
[RunQueryResponse.transaction](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunQueryResponse#_Google_Cloud_Datastore_V1_RunQueryResponse__getTransaction__).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.TransactionOptions` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getReadTime

Reads entities as they were at the given time. This value is only
supported for Cloud Firestore in Datastore mode.

This must be a microsecond precision timestamp within the past one hour,
or if Point-in-Time Recovery is enabled, can additionally be a whole
minute timestamp within the past 7 days.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Timestamp|null` |   |

### hasReadTime

### setReadTime

Reads entities as they were at the given time. This value is only
supported for Cloud Firestore in Datastore mode.

This must be a microsecond precision timestamp within the past one hour,
or if Point-in-Time Recovery is enabled, can additionally be a whole
minute timestamp within the past 7 days.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Protobuf\Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getConsistencyType

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |