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

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

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

## 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.AggregationResultBatch` A batch of aggregation results. Always present. |
| `↳ query` | `https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.AggregationQuery` 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 RunAggregationQuery 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 [RunAggregationQueryRequest.read_options](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunAggregationQueryRequest#_Google_Cloud_Datastore_V1_RunAggregationQueryRequest__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 [RunAggregationQueryRequest.explain_options](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunAggregationQueryRequest#_Google_Cloud_Datastore_V1_RunAggregationQueryRequest__getExplainOptions__) is provided, and it is sent only once with the last response in the stream. |

### getBatch

A batch of aggregation results. Always present.

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

### hasBatch

### clearBatch

### setBatch

A batch of aggregation results. Always present.

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

| **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.AggregationQuery|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.AggregationQuery` |

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

### getTransaction

The identifier of the transaction that was started as part of this
RunAggregationQuery 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
[RunAggregationQueryRequest.read_options](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunAggregationQueryRequest#_Google_Cloud_Datastore_V1_RunAggregationQueryRequest__getReadOptions__).

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

### setTransaction

The identifier of the transaction that was started as part of this
RunAggregationQuery 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
[RunAggregationQueryRequest.read_options](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunAggregationQueryRequest#_Google_Cloud_Datastore_V1_RunAggregationQueryRequest__getReadOptions__).

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

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

### getExplainMetrics

Query explain metrics. This is only present when the
[RunAggregationQueryRequest.explain_options](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunAggregationQueryRequest#_Google_Cloud_Datastore_V1_RunAggregationQueryRequest__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
[RunAggregationQueryRequest.explain_options](https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.RunAggregationQueryRequest#_Google_Cloud_Datastore_V1_RunAggregationQueryRequest__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` |   |