# Google Ads Ad Manager V1 Client - Class AdUnitSize (0.1.1)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [0.1.1 (latest)](https://docs.cloud.google.com/php/docs/reference/googleads/ad-manager/latest/V1.AdUnitSize)
- [0.1.0](https://docs.cloud.google.com/php/docs/reference/googleads/ad-manager/0.1.0/V1.AdUnitSize)
Reference documentation and code samples for the Google Ads Ad Manager V1 Client class AdUnitSize.

Represents the size, environment, and companions of an ad in an ad unit.

Generated from protobuf message `google.ads.admanager.v1.AdUnitSize`

## Namespace

Google \\ Ads \\ AdManager \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ size` | `https://docs.cloud.google.com/php/docs/reference/googleads/ad-manager/latest/V1.Size` Required. The Size of the AdUnit. |
| `↳ environment_type` | `int` Required. The EnvironmentType of the AdUnit |
| `↳ companions` | `array<https://docs.cloud.google.com/php/docs/reference/googleads/ad-manager/latest/V1.Size>` The companions for this ad unit size. Companions are only valid if the environment is [VIDEO_PLAYER](https://docs.cloud.google.com/php/docs/reference/googleads/ad-manager/latest/V1.EnvironmentTypeEnum.EnvironmentType). |

### getSize

Required. The Size of the AdUnit.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/googleads/ad-manager/latest/V1.Size|null` |   |

### hasSize

### clearSize

### setSize

Required. The Size of the AdUnit.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/googleads/ad-manager/latest/V1.Size` |

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

### getEnvironmentType

Required. The EnvironmentType of the AdUnit

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

### setEnvironmentType

Required. The EnvironmentType of the AdUnit

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

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

### getCompanions

The companions for this ad unit size. Companions are only valid if the
environment is
[VIDEO_PLAYER](https://docs.cloud.google.com/php/docs/reference/googleads/ad-manager/latest/V1.EnvironmentTypeEnum.EnvironmentType).

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

### setCompanions

The companions for this ad unit size. Companions are only valid if the
environment is
[VIDEO_PLAYER](https://docs.cloud.google.com/php/docs/reference/googleads/ad-manager/latest/V1.EnvironmentTypeEnum.EnvironmentType).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/googleads/ad-manager/latest/V1.Size>` |

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