Cloud Firestore V1 Client - Class Target (1.32.0)

Reference documentation and code samples for the Cloud Firestore V1 Client class Target.

A specification of a set of documents to listen to.

Generated from protobuf message google.firestore.v1.Target

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ query Google\Cloud\Firestore\V1\Target\QueryTarget

A target specified by a query.

↳ documents Google\Cloud\Firestore\V1\Target\DocumentsTarget

A target specified by a set of document names.

↳ resume_token string

A resume token from a prior TargetChange for an identical target. Using a resume token with a different target is unsupported and may fail.

↳ read_time Google\Protobuf\Timestamp

Start listening after a specific read_time. The client must know the state of matching documents at this time.

↳ target_id int

The target ID that identifies the target on the stream. Must be a positive number and non-zero.

↳ once bool

If the target should be removed once it is current and consistent.

↳ expected_count Google\Protobuf\Int32Value

The number of documents that last matched the query at the resume token or read time. This value is only relevant when a resume_type is provided. This value being present and greater than zero signals that the client wants ExistenceFilter.unchanged_names to be included in the response.

getQuery

A target specified by a query.

Returns
TypeDescription
Google\Cloud\Firestore\V1\Target\QueryTarget|null

hasQuery

setQuery

A target specified by a query.

Parameter
NameDescription
var Google\Cloud\Firestore\V1\Target\QueryTarget
Returns
TypeDescription
$this

getDocuments

A target specified by a set of document names.

Returns
TypeDescription
Google\Cloud\Firestore\V1\Target\DocumentsTarget|null

hasDocuments

setDocuments

A target specified by a set of document names.

Parameter
NameDescription
var Google\Cloud\Firestore\V1\Target\DocumentsTarget
Returns
TypeDescription
$this

getResumeToken

A resume token from a prior TargetChange for an identical target.

Using a resume token with a different target is unsupported and may fail.

Returns
TypeDescription
string

hasResumeToken

setResumeToken

A resume token from a prior TargetChange for an identical target.

Using a resume token with a different target is unsupported and may fail.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getReadTime

Start listening after a specific read_time.

The client must know the state of matching documents at this time.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasReadTime

setReadTime

Start listening after a specific read_time.

The client must know the state of matching documents at this time.

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getTargetId

The target ID that identifies the target on the stream. Must be a positive number and non-zero.

Returns
TypeDescription
int

setTargetId

The target ID that identifies the target on the stream. Must be a positive number and non-zero.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getOnce

If the target should be removed once it is current and consistent.

Returns
TypeDescription
bool

setOnce

If the target should be removed once it is current and consistent.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getExpectedCount

The number of documents that last matched the query at the resume token or read time.

This value is only relevant when a resume_type is provided. This value being present and greater than zero signals that the client wants ExistenceFilter.unchanged_names to be included in the response.

Returns
TypeDescription
Google\Protobuf\Int32Value|null

hasExpectedCount

clearExpectedCount

getExpectedCountValue

Returns the unboxed value from getExpectedCount()

The number of documents that last matched the query at the resume token or read time. This value is only relevant when a resume_type is provided. This value being present and greater than zero signals that the client wants ExistenceFilter.unchanged_names to be included in the response.

Returns
TypeDescription
int|null

setExpectedCount

The number of documents that last matched the query at the resume token or read time.

This value is only relevant when a resume_type is provided. This value being present and greater than zero signals that the client wants ExistenceFilter.unchanged_names to be included in the response.

Parameter
NameDescription
var Google\Protobuf\Int32Value
Returns
TypeDescription
$this

setExpectedCountValue

Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object.

The number of documents that last matched the query at the resume token or read time. This value is only relevant when a resume_type is provided. This value being present and greater than zero signals that the client wants ExistenceFilter.unchanged_names to be included in the response.

Parameter
NameDescription
var int|null
Returns
TypeDescription
$this

getTargetType

Returns
TypeDescription
string

getResumeType

Returns
TypeDescription
string