# Cloud Spanner V1 Client - Class DataChangeRecord (2.9.0)

2.9.0 (latest) 2.8.1 2.7.0 2.6.1 2.5.1 2.4.1 2.3.0 2.2.0 2.1.0 2.0.1-RC1 1.106.0 1.105.1 1.104.1 1.103.0 1.102.0 1.101.0 1.100.0 1.98.0 1.97.0 1.96.0 1.95.0 1.94.0 1.93.1 1.92.1 1.91.0 1.90.0 1.89.0 1.88.0 1.87.0 1.86.0 1.85.0 1.84.0 1.83.0 1.82.0 1.81.0 1.80.0 1.79.0 1.78.0 1.77.0 1.76.1 1.68.0 1.67.0 1.66.0 1.65.0 1.64.0 1.63.2 1.62.1 1.61.0 1.60.0 1.59.0 1.58.4 1.57.0 1.56.0 1.55.0 1.54.2 Reference documentation and code samples for the Cloud Spanner V1 Client class DataChangeRecord.

A data change record contains a set of changes to a table with the same
modification type (insert, update, or delete) committed at the same commit
timestamp in one change stream partition for the same transaction. Multiple
data change records can be returned for the same transaction across
multiple change stream partitions.

Generated from protobuf message `google.spanner.v1.ChangeStreamRecord.DataChangeRecord`

## Namespace

Google \\ Cloud \\ Spanner \\ V1 \\ ChangeStreamRecord

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ commit_timestamp` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Indicates the timestamp in which the change was committed. DataChangeRecord.commit_timestamps, PartitionStartRecord.start_timestamps, PartitionEventRecord.commit_timestamps, and PartitionEndRecord.end_timestamps can have the same value in the same partition. |
| `↳ record_sequence` | `string` Record sequence numbers are unique and monotonically increasing (but not necessarily contiguous) for a specific timestamp across record types in the same partition. To guarantee ordered processing, the reader should process records (of potentially different types) in record_sequence order for a specific timestamp in the same partition. The record sequence number ordering across partitions is only meaningful in the context of a specific transaction. Record sequence numbers are unique across partitions for a specific transaction. Sort the DataChangeRecords for the same [server_transaction_id](https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord#_Google_Cloud_Spanner_V1_ChangeStreamRecord_DataChangeRecord__getServerTransactionId__) by [record_sequence](https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord#_Google_Cloud_Spanner_V1_ChangeStreamRecord_DataChangeRecord__getRecordSequence__) to reconstruct the ordering of the changes within the transaction. |
| `↳ server_transaction_id` | `string` Provides a globally unique string that represents the transaction in which the change was committed. Multiple transactions can have the same commit timestamp, but each transaction has a unique server_transaction_id. |
| `↳ is_last_record_in_transaction_in_partition` | `bool` Indicates whether this is the last record for a transaction in the current partition. Clients can use this field to determine when all records for a transaction in the current partition have been received. |
| `↳ table` | `string` Name of the table affected by the change. |
| `↳ column_metadata` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata>` Provides metadata describing the columns associated with the [mods](https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord#_Google_Cloud_Spanner_V1_ChangeStreamRecord_DataChangeRecord__getMods__) listed below. |
| `↳ mods` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord.Mod>` Describes the changes that were made. |
| `↳ mod_type` | `int` Describes the type of change. |
| `↳ value_capture_type` | `int` Describes the value capture type that was specified in the change stream configuration when this change was captured. |
| `↳ number_of_records_in_transaction` | `int` Indicates the number of data change records that are part of this transaction across all change stream partitions. This value can be used to assemble all the records associated with a particular transaction. |
| `↳ number_of_partitions_in_transaction` | `int` Indicates the number of partitions that return data change records for this transaction. This value can be helpful in assembling all records associated with a particular transaction. |
| `↳ transaction_tag` | `string` Indicates the transaction tag associated with this transaction. |
| `↳ is_system_transaction` | `bool` Indicates whether the transaction is a system transaction. System transactions include those issued by time-to-live (TTL), column backfill, etc. |

### getCommitTimestamp

Indicates the timestamp in which the change was committed.

DataChangeRecord.commit_timestamps,
PartitionStartRecord.start_timestamps,
PartitionEventRecord.commit_timestamps, and
PartitionEndRecord.end_timestamps can have the same value in the same
partition.

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

### hasCommitTimestamp

### clearCommitTimestamp

### setCommitTimestamp

Indicates the timestamp in which the change was committed.

DataChangeRecord.commit_timestamps,
PartitionStartRecord.start_timestamps,
PartitionEventRecord.commit_timestamps, and
PartitionEndRecord.end_timestamps can have the same value in the same
partition.

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

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

### getRecordSequence

Record sequence numbers are unique and monotonically increasing (but not
necessarily contiguous) for a specific timestamp across record
types in the same partition. To guarantee ordered processing, the reader
should process records (of potentially different types) in
record_sequence order for a specific timestamp in the same partition.

The record sequence number ordering across partitions is only meaningful
in the context of a specific transaction. Record sequence numbers are
unique across partitions for a specific transaction. Sort the
DataChangeRecords for the same
[server_transaction_id](https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord#_Google_Cloud_Spanner_V1_ChangeStreamRecord_DataChangeRecord__getServerTransactionId__)
by
[record_sequence](https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord#_Google_Cloud_Spanner_V1_ChangeStreamRecord_DataChangeRecord__getRecordSequence__)
to reconstruct the ordering of the changes within the transaction.

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

### setRecordSequence

Record sequence numbers are unique and monotonically increasing (but not
necessarily contiguous) for a specific timestamp across record
types in the same partition. To guarantee ordered processing, the reader
should process records (of potentially different types) in
record_sequence order for a specific timestamp in the same partition.

The record sequence number ordering across partitions is only meaningful
in the context of a specific transaction. Record sequence numbers are
unique across partitions for a specific transaction. Sort the
DataChangeRecords for the same
[server_transaction_id](https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord#_Google_Cloud_Spanner_V1_ChangeStreamRecord_DataChangeRecord__getServerTransactionId__)
by
[record_sequence](https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord#_Google_Cloud_Spanner_V1_ChangeStreamRecord_DataChangeRecord__getRecordSequence__)
to reconstruct the ordering of the changes within the transaction.

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

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

### getServerTransactionId

Provides a globally unique string that represents the transaction in
which the change was committed. Multiple transactions can have the same
commit timestamp, but each transaction has a unique
server_transaction_id.

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

### setServerTransactionId

Provides a globally unique string that represents the transaction in
which the change was committed. Multiple transactions can have the same
commit timestamp, but each transaction has a unique
server_transaction_id.

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

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

### getIsLastRecordInTransactionInPartition

Indicates whether this is the last record for a transaction in the
current partition. Clients can use this field to determine when all
records for a transaction in the current partition have been received.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setIsLastRecordInTransactionInPartition

Indicates whether this is the last record for a transaction in the
current partition. Clients can use this field to determine when all
records for a transaction in the current partition have been received.

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

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

### getTable

Name of the table affected by the change.

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

### setTable

Name of the table affected by the change.

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

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

### getColumnMetadata

Provides metadata describing the columns associated with the
[mods](https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord#_Google_Cloud_Spanner_V1_ChangeStreamRecord_DataChangeRecord__getMods__) listed
below.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata>` |   |

### setColumnMetadata

Provides metadata describing the columns associated with the
[mods](https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord#_Google_Cloud_Spanner_V1_ChangeStreamRecord_DataChangeRecord__getMods__) listed
below.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata>` |

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

### getMods

Describes the changes that were made.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord.Mod>` |   |

### setMods

Describes the changes that were made.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord.Mod>` |

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

### getModType

Describes the type of change.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ModType](https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord.ModType). |

### setModType

Describes the type of change.

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

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

### getValueCaptureType

Describes the value capture type that was specified in the change stream
configuration when this change was captured.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ValueCaptureType](https://docs.cloud.google.com/php/docs/reference/cloud-spanner/latest/V1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType). |

### setValueCaptureType

Describes the value capture type that was specified in the change stream
configuration when this change was captured.

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

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

### getNumberOfRecordsInTransaction

Indicates the number of data change records that are part of this
transaction across all change stream partitions. This value can be used
to assemble all the records associated with a particular transaction.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setNumberOfRecordsInTransaction

Indicates the number of data change records that are part of this
transaction across all change stream partitions. This value can be used
to assemble all the records associated with a particular transaction.

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

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

### getNumberOfPartitionsInTransaction

Indicates the number of partitions that return data change records for
this transaction. This value can be helpful in assembling all records
associated with a particular transaction.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setNumberOfPartitionsInTransaction

Indicates the number of partitions that return data change records for
this transaction. This value can be helpful in assembling all records
associated with a particular transaction.

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

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

### getTransactionTag

Indicates the transaction tag associated with this transaction.

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

### setTransactionTag

Indicates the transaction tag associated with this transaction.

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

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

### getIsSystemTransaction

Indicates whether the transaction is a system transaction. System
transactions include those issued by time-to-live (TTL), column backfill,
etc.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setIsSystemTransaction

Indicates whether the transaction is a system transaction. System
transactions include those issued by time-to-live (TTL), column backfill,
etc.

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

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