# Cloud Firestore V1 Client - Class Value (2.2.0-RC1)

2.2.0-RC1 2.1.0 (latest) 2.0.2-RC1 1.55.0 1.54.4 1.53.1 1.52.0 1.51.0 1.50.0 1.48.1 1.47.3 1.46.0 1.45.2 1.44.1 1.43.3 1.40.0 1.39.0 1.38.0 1.37.7 1.36.1 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.28.0 1.27.3 Reference documentation and code samples for the Cloud Firestore V1 Client class Value.

A message that can hold any of the supported value types.

Generated from protobuf message `google.firestore.v1.Value`

## Namespace

Google \\ Cloud \\ Firestore \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ null_value` | `int` A null value. |
| `↳ boolean_value` | `bool` A boolean value. |
| `↳ integer_value` | `int|string` An integer value. |
| `↳ double_value` | `float` A double value. |
| `↳ timestamp_value` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down. |
| `↳ string_value` | `string` A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries. |
| `↳ bytes_value` | `string` A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries. |
| `↳ reference_value` | `string` A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. |
| `↳ geo_point_value` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.LatLng.html` A geo point value representing a point on the surface of Earth. |
| `↳ array_value` | `https://docs.cloud.google.com/php/docs/reference/cloud-firestore/latest/V1.ArrayValue` An array value. Cannot directly contain another array value, though can contain a map which contains another array. |
| `↳ map_value` | `https://docs.cloud.google.com/php/docs/reference/cloud-firestore/latest/V1.MapValue` A map value. |
| `↳ field_reference_value` | `string` Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** \* \* Must follow field reference limitations. \* \* Not allowed to be used when writing documents. |
| `↳ variable_reference_value` | `string` Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document. |
| `↳ function_value` | `https://docs.cloud.google.com/php/docs/reference/cloud-firestore/latest/V1.PBFunction` A value that represents an unevaluated expression. **Requires:** \* \* Not allowed to be used when writing documents. |
| `↳ pipeline_value` | `https://docs.cloud.google.com/php/docs/reference/cloud-firestore/latest/V1.Pipeline` A value that represents an unevaluated pipeline. **Requires:** \* \* Not allowed to be used when writing documents. |

### getNullValue

A null value.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [NullValue](https://protobuf.dev/reference/php/api-docs/NullValue). |

### hasNullValue

### setNullValue

A null value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [NullValue](https://protobuf.dev/reference/php/api-docs/NullValue). |

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

### getBooleanValue

A boolean value.

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

### hasBooleanValue

### setBooleanValue

A boolean value.

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

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

### getIntegerValue

An integer value.

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

### hasIntegerValue

### setIntegerValue

An integer value.

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

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

### getDoubleValue

A double value.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### hasDoubleValue

### setDoubleValue

A double value.

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

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

### getTimestampValue

A timestamp value.

Precise only to microseconds. When stored, any additional precision is
rounded down.

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

### hasTimestampValue

### setTimestampValue

A timestamp value.

Precise only to microseconds. When stored, any additional precision is
rounded down.

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

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

### getStringValue

A string value.

The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes.
Only the first 1,500 bytes of the UTF-8 representation are considered by
queries.

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

### hasStringValue

### setStringValue

A string value.

The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes.
Only the first 1,500 bytes of the UTF-8 representation are considered by
queries.

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

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

### getBytesValue

A bytes value.

Must not exceed 1 MiB - 89 bytes.
Only the first 1,500 bytes are considered by queries.

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

### hasBytesValue

### setBytesValue

A bytes value.

Must not exceed 1 MiB - 89 bytes.
Only the first 1,500 bytes are considered by queries.

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

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

### getReferenceValue

A reference to a document. For example:
`projects/{project_id}/databases/{database_id}/documents/{document_path}`.

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

### hasReferenceValue

### setReferenceValue

A reference to a document. For example:
`projects/{project_id}/databases/{database_id}/documents/{document_path}`.

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

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

### getGeoPointValue

A geo point value representing a point on the surface of Earth.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.LatLng.html|null` |   |

### hasGeoPointValue

### setGeoPointValue

A geo point value representing a point on the surface of Earth.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.LatLng.html` |

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

### getArrayValue

An array value.

Cannot directly contain another array value, though can contain a
map which contains another array.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-firestore/latest/V1.ArrayValue|null` |   |

### hasArrayValue

### setArrayValue

An array value.

Cannot directly contain another array value, though can contain a
map which contains another array.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-firestore/latest/V1.ArrayValue` |

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

### getMapValue

A map value.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-firestore/latest/V1.MapValue|null` |   |

### hasMapValue

### setMapValue

A map value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-firestore/latest/V1.MapValue` |

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

### getFieldReferenceValue

Value which references a field.

This is considered relative (vs absolute) since it only refers to a field
and not a field within a particular document.
**Requires:**

- Must follow field reference limitations.
- Not allowed to be used when writing documents.

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

### hasFieldReferenceValue

### setFieldReferenceValue

Value which references a field.

This is considered relative (vs absolute) since it only refers to a field
and not a field within a particular document.
**Requires:**

- Must follow field reference limitations.
- Not allowed to be used when writing documents.

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

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

### getVariableReferenceValue

Pointer to a variable defined elsewhere in a pipeline.

Unlike `field_reference_value` which references a field within a
document, this refers to a variable, defined in a separate namespace than
the fields of a document.

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

### hasVariableReferenceValue

### setVariableReferenceValue

Pointer to a variable defined elsewhere in a pipeline.

Unlike `field_reference_value` which references a field within a
document, this refers to a variable, defined in a separate namespace than
the fields of a document.

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

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

### getFunctionValue

A value that represents an unevaluated expression.

**Requires:**

- Not allowed to be used when writing documents.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-firestore/latest/V1.PBFunction|null` |   |

### hasFunctionValue

### setFunctionValue

A value that represents an unevaluated expression.

**Requires:**

- Not allowed to be used when writing documents.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-firestore/latest/V1.PBFunction` |

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

### getPipelineValue

A value that represents an unevaluated pipeline.

**Requires:**

- Not allowed to be used when writing documents.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-firestore/latest/V1.Pipeline|null` |   |

### hasPipelineValue

### setPipelineValue

A value that represents an unevaluated pipeline.

**Requires:**

- Not allowed to be used when writing documents.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-firestore/latest/V1.Pipeline` |

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

### getValueType

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