# Google Cloud Dialogflow V2 Client - Class ContextReference (2.4.0)

2.4.0 (latest) 2.3.1 2.2.1 2.1.2 2.0.1 1.17.2 1.16.0 1.15.1 1.14.0 1.13.0 1.12.3 1.11.0 1.10.2 1.9.0 1.8.0 1.7.2 1.6.0 1.5.0 1.4.0 1.3.2 1.2.0 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class ContextReference.

Represents a section of ingested context information.

Generated from protobuf message `google.cloud.dialogflow.v2.Conversation.ContextReference`

## Namespace

Google \\ Cloud \\ Dialogflow \\ V2 \\ Conversation

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ context_contents` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Conversation.ContextReference.ContextContent>` Required. The list of content updates for a context reference. |
| `↳ update_mode` | `int` Required. The mode in which context reference contents are updated. |
| `↳ language_code` | `string` Optional. The language of the information ingested, defaults to "en-US" if not set. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time the context reference was first created. |

### getContextContents

Required. The list of content updates for a context reference.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Conversation.ContextReference.ContextContent>` |   |

### setContextContents

Required. The list of content updates for a context reference.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Conversation.ContextReference.ContextContent>` |

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

### getUpdateMode

Required. The mode in which context reference contents are updated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [UpdateMode](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Conversation.ContextReference.UpdateMode). |

### setUpdateMode

Required. The mode in which context reference contents are updated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [UpdateMode](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Conversation.ContextReference.UpdateMode). |

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

### getLanguageCode

Optional. The language of the information ingested, defaults to "en-US"
if not set.

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

### setLanguageCode

Optional. The language of the information ingested, defaults to "en-US"
if not set.

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

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

### getCreateTime

Output only. The time the context reference was first created.

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

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The time the context reference was first created.

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

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