Cloud Firestore V1 Client - Class TargetChange (1.31.0)

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

Methods

__construct

Constructor.

Parameters
NameDescription
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 Google\Rpc\Status

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 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
TypeDescription
int

setTargetChangeType

The type of change that occurred.

Parameter
NameDescription
var int
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var int[]
Returns
TypeDescription
$this

getCause

The error that resulted in this change, if applicable.

Returns
TypeDescription
Google\Rpc\Status|null

hasCause

clearCause

setCause

The error that resulted in this change, if applicable.

Parameter
NameDescription
var Google\Rpc\Status
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this