# Google Cloud Document Ai V1 Client - Class Entity (2.7.0)

2.7.0 (latest) 2.6.1 2.5.1 2.4.1 2.3.0 2.2.2 2.1.3 2.0.0 1.14.0 1.13.1 1.12.2 1.9.0 1.8.2 1.7.0 1.6.0 1.5.0 1.4.0 1.3.0 1.2.2 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Document Ai V1 Client class Entity.

An entity that could be a phrase in the text or a property that belongs to
the document. It is a known entity type, such as a person, an organization,
or location.

Generated from protobuf message `google.cloud.documentai.v1.Document.Entity`

## Namespace

Google \\ Cloud \\ DocumentAI \\ V1 \\ Document

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ text_anchor` | `https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.TextAnchor` Optional. Provenance of the entity. Text anchor indexing into the [Document.text](https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document#_Google_Cloud_DocumentAI_V1_Document__getText__). |
| `↳ type` | `string` Required. Entity type from a schema, for example, `Address`. |
| `↳ mention_text` | `string` Optional. Text value of the entity, for example, `1600 Amphitheatre Pkwy`. |
| `↳ mention_id` | `string` Optional. Deprecated. Use `id` field instead. |
| `↳ confidence` | `float` Optional. Confidence of detected Schema entity. Range `[0, 1]`. |
| `↳ page_anchor` | `https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.PageAnchor` Optional. Represents the provenance of this entity wrt. the location on the page where it was found. |
| `↳ id` | `string` Optional. Canonical id. This will be a unique value in the entity list for this document. |
| `↳ normalized_value` | `https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.Entity.NormalizedValue` Optional. Normalized entity value. Absent if the extracted value could not be converted or the type (for example, address) is not supported for certain parsers. This field is also only populated for certain supported document types. |
| `↳ properties` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.Entity>` Optional. Entities can be nested to form a hierarchical data structure representing the content in the document. |
| `↳ provenance` | `https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.Provenance` Optional. The history of this annotation. |
| `↳ redacted` | `bool` Optional. Whether the entity will be redacted for de-identification purposes. |
| `↳ method` | `int` Optional. Specifies how the entity's value is obtained. |

### getTextAnchor

Optional. Provenance of the entity.

Text anchor indexing into the
[Document.text](https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document#_Google_Cloud_DocumentAI_V1_Document__getText__).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.TextAnchor|null` |   |

### hasTextAnchor

### clearTextAnchor

### setTextAnchor

Optional. Provenance of the entity.

Text anchor indexing into the
[Document.text](https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document#_Google_Cloud_DocumentAI_V1_Document__getText__).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.TextAnchor` |

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

### getType

Required. Entity type from a schema, for example, `Address`.

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

### setType

Required. Entity type from a schema, for example, `Address`.

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

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

### getMentionText

Optional. Text value of the entity, for example, `1600 Amphitheatre
Pkwy`.

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

### setMentionText

Optional. Text value of the entity, for example, `1600 Amphitheatre
Pkwy`.

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

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

### getMentionId

Optional. Deprecated. Use `id` field instead.

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

### setMentionId

Optional. Deprecated. Use `id` field instead.

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

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

### getConfidence

Optional. Confidence of detected Schema entity. Range `[0, 1]`.

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

### setConfidence

Optional. Confidence of detected Schema entity. Range `[0, 1]`.

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

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

### getPageAnchor

Optional. Represents the provenance of this entity wrt. the location on
the page where it was found.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.PageAnchor|null` |   |

### hasPageAnchor

### clearPageAnchor

### setPageAnchor

Optional. Represents the provenance of this entity wrt. the location on
the page where it was found.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.PageAnchor` |

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

### getId

Optional. Canonical id. This will be a unique value in the entity list
for this document.

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

### setId

Optional. Canonical id. This will be a unique value in the entity list
for this document.

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

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

### getNormalizedValue

Optional. Normalized entity value. Absent if the extracted value could
not be converted or the type (for example, address) is not supported for
certain parsers. This field is also only populated for certain supported
document types.

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

### hasNormalizedValue

### clearNormalizedValue

### setNormalizedValue

Optional. Normalized entity value. Absent if the extracted value could
not be converted or the type (for example, address) is not supported for
certain parsers. This field is also only populated for certain supported
document types.

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

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

### getProperties

Optional. Entities can be nested to form a hierarchical data structure
representing the content in the document.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.Entity>` |   |

### setProperties

Optional. Entities can be nested to form a hierarchical data structure
representing the content in the document.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.Entity>` |

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

### getProvenance

Optional. The history of this annotation.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.Provenance|null` |   |

### hasProvenance

### clearProvenance

### setProvenance

Optional. The history of this annotation.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.Provenance` |

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

### getRedacted

Optional. Whether the entity will be redacted for de-identification
purposes.

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

### setRedacted

Optional. Whether the entity will be redacted for de-identification
purposes.

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

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

### getMethod

Optional. Specifies how the entity's value is obtained.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Method](https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.Entity.Method). |

### setMethod

Optional. Specifies how the entity's value is obtained.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Method](https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.Entity.Method). |

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