# Cloud Vision V1 Client - Class Feature (2.2.1)

2.2.1 (latest) 2.2.0 2.1.3 2.0.3 1.10.3 1.9.4 1.8.0 1.7.6 1.6.8 Reference documentation and code samples for the Cloud Vision V1 Client class Feature.

The type of Google Cloud Vision API detection to perform, and the maximum
number of results to return for that type. Multiple `Feature` objects can
be specified in the `features` list.

Generated from protobuf message `google.cloud.vision.v1.Feature`

## Namespace

Google \\ Cloud \\ Vision \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ type` | `int` The feature type. |
| `↳ max_results` | `int` Maximum number of results of this type. Does not apply to `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. |
| `↳ model` | `string` Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and "builtin/latest". `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` also support "builtin/weekly" for the bleeding edge release updated weekly. |

### getType

The feature type.

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

### setType

The feature type.

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

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

### getMaxResults

Maximum number of results of this type. Does not apply to
`TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.

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

### setMaxResults

Maximum number of results of this type. Does not apply to
`TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`.

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

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

### getModel

Model to use for the feature.

Supported values: "builtin/stable" (the default if unset) and
"builtin/latest". `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` also
support "builtin/weekly" for the bleeding edge release updated weekly.

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

### setModel

Model to use for the feature.

Supported values: "builtin/stable" (the default if unset) and
"builtin/latest". `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` also
support "builtin/weekly" for the bleeding edge release updated weekly.

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

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