Cloud Firestore V1 Client - Class TtlConfig (2.3.3)

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

The TTL (time-to-live) configuration for documents that have this Field set.

A timestamp stored in a TTL-enabled field will be used to determine the expiration time of the document. The expiration time is the sum of the timestamp value and the expiration_offset. For Enterprise edition databases, the timestamp value may alternatively be stored in an array value in the TTL-enabled field. An expiration time in the past indicates that the document is eligible for immediate expiration. Using any other data type or leaving the field absent will disable expiration for the individual document.

Generated from protobuf message google.firestore.admin.v1.Field.TtlConfig

Namespace

Google \ Cloud \ Firestore \ Admin \ V1 \ Field

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ state int

Output only. The state of the TTL configuration.

↳ expiration_offset Google\Protobuf\Duration

Optional. The offset, relative to the timestamp value from the TTL-enabled field, used to determine the document's expiration time. expiration_offset.seconds must be between 0 and 2,147,483,647 inclusive. Values more precise than seconds are rejected. If unset, defaults to 0, in which case the expiration time is the same as the timestamp value from the TTL-enabled field.

getState

Output only. The state of the TTL configuration.

Returns
Type Description
int Enum of type State.

setState

Output only. The state of the TTL configuration.

Parameter
Name Description
var int

Enum of type State.

Returns
Type Description
$this

getExpirationOffset

Optional. The offset, relative to the timestamp value from the TTL-enabled field, used to determine the document's expiration time.

expiration_offset.seconds must be between 0 and 2,147,483,647 inclusive. Values more precise than seconds are rejected. If unset, defaults to 0, in which case the expiration time is the same as the timestamp value from the TTL-enabled field.

Returns
Type Description
Google\Protobuf\Duration|null

hasExpirationOffset

clearExpirationOffset

setExpirationOffset

Optional. The offset, relative to the timestamp value from the TTL-enabled field, used to determine the document's expiration time.

expiration_offset.seconds must be between 0 and 2,147,483,647 inclusive. Values more precise than seconds are rejected. If unset, defaults to 0, in which case the expiration time is the same as the timestamp value from the TTL-enabled field.

Parameter
Name Description
var Google\Protobuf\Duration
Returns
Type Description
$this