# Cloud Firestore V1 Client - Class TargetChange (2.2.0-RC1)

2.2.0-RC1 2.1.0 (latest) 2.0.2-RC1 1.55.0 1.54.4 1.53.1 1.52.0 1.51.0 1.50.0 1.48.1 1.47.3 1.46.0 1.45.2 1.44.1 1.43.3 1.40.0 1.39.0 1.38.0 1.37.7 1.36.1 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.28.0 1.27.3 Reference documentation and code samples for the Cloud Firestore V1 Client class TargetChange.

Targets being watched have changed.

Generated from protobuf message `google.firestore.v1.TargetChange`

## Namespace

Google \\ Cloud \\ Firestore \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ target_change_type` | `int` The type of change that occurred. |
| `↳ target_ids` | `array` The target IDs of targets that have changed. If empty, the change applies to all targets. The order of the target IDs is not defined. |
| `↳ cause` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html` The error that resulted in this change, if applicable. |
| `↳ resume_token` | `string` A token that can be used to resume the stream for the given `target_ids`, or all targets if `target_ids` is empty. Not set on every target change. |
| `↳ read_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` The consistent `read_time` for the given `target_ids` (omitted when the target_ids are not at a consistent snapshot). The stream is guaranteed to send a `read_time` with `target_ids` empty whenever the entire stream reaches a new consistent snapshot. ADD, CURRENT, and RESET messages are guaranteed to (eventually) result in a new consistent snapshot (while NO_CHANGE and REMOVE messages are not). For a given stream, `read_time` is guaranteed to be monotonically increasing. |

### getTargetChangeType

The type of change that occurred.

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

### setTargetChangeType

The type of change that occurred.

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

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

### getTargetIds

The target IDs of targets that have changed.

If empty, the change applies to all targets.
The order of the target IDs is not defined.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/RepeatedField` |   |

### setTargetIds

The target IDs of targets that have changed.

If empty, the change applies to all targets.
The order of the target IDs is not defined.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int[]` |

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

### getCause

The error that resulted in this change, if applicable.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html|null` |   |

### hasCause

### clearCause

### setCause

The error that resulted in this change, if applicable.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html` |

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

### getResumeToken

A token that can be used to resume the stream for the given `target_ids`,
or all targets if `target_ids` is empty.

Not set on every target change.

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

### setResumeToken

A token that can be used to resume the stream for the given `target_ids`,
or all targets if `target_ids` is empty.

Not set on every target change.

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

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

### getReadTime

The consistent `read_time` for the given `target_ids` (omitted when the
target_ids are not at a consistent snapshot).

The stream is guaranteed to send a `read_time` with `target_ids` empty
whenever the entire stream reaches a new consistent snapshot. ADD,
CURRENT, and RESET messages are guaranteed to (eventually) result in a
new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
For a given stream, `read_time` is guaranteed to be monotonically
increasing.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasReadTime

### clearReadTime

### setReadTime

The consistent `read_time` for the given `target_ids` (omitted when the
target_ids are not at a consistent snapshot).

The stream is guaranteed to send a `read_time` with `target_ids` empty
whenever the entire stream reaches a new consistent snapshot. ADD,
CURRENT, and RESET messages are guaranteed to (eventually) result in a
new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
For a given stream, `read_time` is guaranteed to be monotonically
increasing.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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