# Cloud Natural Language V1 Client - Class EntityMention (1.2.1)

1.2.1 (latest) 1.2.0 1.1.4 1.0.1 0.34.3 0.33.0 0.32.7 0.31.3 0.30.2 0.29.0 0.28.5 Reference documentation and code samples for the Cloud Natural Language V1 Client class EntityMention.

Represents a mention for an entity in the text. Currently, proper noun
mentions are supported.

Generated from protobuf message `google.cloud.language.v1.EntityMention`

## Namespace

Google \\ Cloud \\ Language \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ text` | `https://docs.cloud.google.com/php/docs/reference/cloud-language/latest/V1.TextSpan` The mention text. |
| `↳ type` | `int` The type of the entity mention. |
| `↳ sentiment` | `https://docs.cloud.google.com/php/docs/reference/cloud-language/latest/V1.Sentiment` For calls to AnalyzeEntitySentiment or if [AnnotateTextRequest.Features.extract_entity_sentiment](https://docs.cloud.google.com/php/docs/reference/cloud-language/latest/V1.AnnotateTextRequest.Features#_Google_Cloud_Language_V1_AnnotateTextRequest_Features__getExtractEntitySentiment__) is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document. |

### getText

The mention text.

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

### hasText

### clearText

### setText

The mention text.

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

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

### getType

The type of the entity mention.

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

### setType

The type of the entity mention.

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

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

### getSentiment

For calls to AnalyzeEntitySentiment or if
[AnnotateTextRequest.Features.extract_entity_sentiment](https://docs.cloud.google.com/php/docs/reference/cloud-language/latest/V1.AnnotateTextRequest.Features#_Google_Cloud_Language_V1_AnnotateTextRequest_Features__getExtractEntitySentiment__)
is set to true, this field will contain the sentiment expressed for this
mention of the entity in the provided document.

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

### hasSentiment

### clearSentiment

### setSentiment

For calls to AnalyzeEntitySentiment or if
[AnnotateTextRequest.Features.extract_entity_sentiment](https://docs.cloud.google.com/php/docs/reference/cloud-language/latest/V1.AnnotateTextRequest.Features#_Google_Cloud_Language_V1_AnnotateTextRequest_Features__getExtractEntitySentiment__)
is set to true, this field will contain the sentiment expressed for this
mention of the entity in the provided document.

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

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