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 RunQueryResponse.

The response for
[Datastore.RunQuery](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.Client.DatastoreClient#_Google_Cloud_Datastore_V1_Client_DatastoreClient__runQuery__).

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

## Namespace

Google \\ Cloud \\ Datastore \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ batch` | `https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.QueryResultBatch` A batch of query results. This is always present unless running a query under explain-only mode: [RunQueryRequest.explain_options](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunQueryRequest#_Google_Cloud_Datastore_V1_RunQueryRequest__getExplainOptions__) was provided and [ExplainOptions.analyze](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.ExplainOptions#_Google_Cloud_Datastore_V1_ExplainOptions__getAnalyze__) was set to false. |
| `↳ query` | `https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.Query` The parsed form of the `GqlQuery` from the request, if it was set. |
| `↳ transaction` | `string` The identifier of the transaction that was started as part of this RunQuery request. Set only when [ReadOptions.new_transaction](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.ReadOptions#_Google_Cloud_Datastore_V1_ReadOptions__getNewTransaction__) was set in [RunQueryRequest.read_options](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunQueryRequest#_Google_Cloud_Datastore_V1_RunQueryRequest__getReadOptions__). |
| `↳ explain_metrics` | `https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.ExplainMetrics` Query explain metrics. This is only present when the [RunQueryRequest.explain_options](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunQueryRequest#_Google_Cloud_Datastore_V1_RunQueryRequest__getExplainOptions__) is provided, and it is sent only once with the last response in the stream. |

### getBatch

A batch of query results. This is always present unless running a
query under explain-only
mode:
[RunQueryRequest.explain_options](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunQueryRequest#_Google_Cloud_Datastore_V1_RunQueryRequest__getExplainOptions__)
was provided and
[ExplainOptions.analyze](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.ExplainOptions#_Google_Cloud_Datastore_V1_ExplainOptions__getAnalyze__) was
set to false.

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

### hasBatch

### clearBatch

### setBatch

A batch of query results. This is always present unless running a
query under explain-only
mode:
[RunQueryRequest.explain_options](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunQueryRequest#_Google_Cloud_Datastore_V1_RunQueryRequest__getExplainOptions__)
was provided and
[ExplainOptions.analyze](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.ExplainOptions#_Google_Cloud_Datastore_V1_ExplainOptions__getAnalyze__) was
set to false.

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

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

### getQuery

The parsed form of the `GqlQuery` from the request, if it was set.

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

### hasQuery

### clearQuery

### setQuery

The parsed form of the `GqlQuery` from the request, if it was set.

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

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

### getTransaction

The identifier of the transaction that was started as part of this
RunQuery request.

Set only when
[ReadOptions.new_transaction](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.ReadOptions#_Google_Cloud_Datastore_V1_ReadOptions__getNewTransaction__)
was set in
[RunQueryRequest.read_options](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunQueryRequest#_Google_Cloud_Datastore_V1_RunQueryRequest__getReadOptions__).

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

### setTransaction

The identifier of the transaction that was started as part of this
RunQuery request.

Set only when
[ReadOptions.new_transaction](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.ReadOptions#_Google_Cloud_Datastore_V1_ReadOptions__getNewTransaction__)
was set in
[RunQueryRequest.read_options](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunQueryRequest#_Google_Cloud_Datastore_V1_RunQueryRequest__getReadOptions__).

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

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

### getExplainMetrics

Query explain metrics. This is only present when the
[RunQueryRequest.explain_options](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunQueryRequest#_Google_Cloud_Datastore_V1_RunQueryRequest__getExplainOptions__)
is provided, and it is sent only once with the last response in the stream.

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

### hasExplainMetrics

### clearExplainMetrics

### setExplainMetrics

Query explain metrics. This is only present when the
[RunQueryRequest.explain_options](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunQueryRequest#_Google_Cloud_Datastore_V1_RunQueryRequest__getExplainOptions__)
is provided, and it is sent only once with the last response in the stream.

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

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