2.2.0 (latest) 2.0.6 1.34.2 1.33.1 1.32.3 1.31.0 1.30.0 1.29.2 1.28.2 1.26.0 1.25.0 1.24.4 1.23.0 1.22.1 1.21.2 1.19.0 1.18.1 1.17.1 Reference documentation and code samples for the Cloud Datastore V1 Client class Value.

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

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

## Namespace

Google \\ Cloud \\ Datastore \\ 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` | `Google\Protobuf\Timestamp` A timestamp value. When stored in the Datastore, precise only to microseconds; any additional precision is rounded down. |
| `↳ key_value` | `https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.Key` A key value. |
| `↳ string_value` | `string` A UTF-8 encoded string value. When `exclude_from_indexes` is false (it is indexed) , may have at most 1500 bytes. Otherwise, may be set to at most 1,000,000 bytes. |
| `↳ blob_value` | `string` A blob value. May have at most 1,000,000 bytes. When `exclude_from_indexes` is false, may have at most 1500 bytes. In JSON requests, must be base64-encoded. |
| `↳ 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. |
| `↳ entity_value` | `https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.Entity` An entity value. - May have no key. - May have a key with an incomplete key path. - May have a reserved/read-only key. |
| `↳ array_value` | `https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.ArrayValue` An array value. Cannot contain another array value. A `Value` instance that sets field `array_value` must not set fields `meaning` or `exclude_from_indexes`. |
| `↳ meaning` | `int` The `meaning` field should only be populated for backwards compatibility. |
| `↳ exclude_from_indexes` | `bool` If the value should be excluded from all indexes including those defined explicitly. |

### getNullValue

A null value.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type NullValue. |

### hasNullValue

### setNullValue

A null value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type 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.

When stored in the Datastore, precise only to microseconds;
any additional precision is rounded down.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Timestamp|null` |   |

### hasTimestampValue

### setTimestampValue

A timestamp value.

When stored in the Datastore, precise only to microseconds;
any additional precision is rounded down.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Protobuf\Timestamp` |

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

### getKeyValue

A key value.

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

### hasKeyValue

### setKeyValue

A key value.

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

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

### getStringValue

A UTF-8 encoded string value.

When `exclude_from_indexes` is false (it is indexed) , may have at most
1500 bytes. Otherwise, may be set to at most 1,000,000 bytes.

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

### hasStringValue

### setStringValue

A UTF-8 encoded string value.

When `exclude_from_indexes` is false (it is indexed) , may have at most
1500 bytes. Otherwise, may be set to at most 1,000,000 bytes.

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

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

### getBlobValue

A blob value.

May have at most 1,000,000 bytes.
When `exclude_from_indexes` is false, may have at most 1500 bytes.
In JSON requests, must be base64-encoded.

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

### hasBlobValue

### setBlobValue

A blob value.

May have at most 1,000,000 bytes.
When `exclude_from_indexes` is false, may have at most 1500 bytes.
In JSON requests, must be base64-encoded.

| **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` |   |

### getEntityValue

An entity value.

- May have no key.
- May have a key with an incomplete key path.
- May have a reserved/read-only key.

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

### hasEntityValue

### setEntityValue

An entity value.

- May have no key.
- May have a key with an incomplete key path.
- May have a reserved/read-only key.

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

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

### getArrayValue

An array value.

Cannot contain another array value.
A `Value` instance that sets field `array_value` must not set fields
`meaning` or `exclude_from_indexes`.

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

### hasArrayValue

### setArrayValue

An array value.

Cannot contain another array value.
A `Value` instance that sets field `array_value` must not set fields
`meaning` or `exclude_from_indexes`.

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

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

### getMeaning

The `meaning` field should only be populated for backwards compatibility.

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

### setMeaning

The `meaning` field should only be populated for backwards compatibility.

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

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

### getExcludeFromIndexes

If the value should be excluded from all indexes including those defined
explicitly.

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

### setExcludeFromIndexes

If the value should be excluded from all indexes including those defined
explicitly.

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

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

### getValueType

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