# Google Shopping Common Protos Client - Class CustomAttribute (0.5.0)

0.5.0 (latest) 0.4.4 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the Google Shopping Common Protos Client class CustomAttribute.

A message that represents custom attributes. Exactly one of `value` or
`group_values` must not be empty.

Generated from protobuf message `google.shopping.type.CustomAttribute`

## Namespace

Google \\ Shopping \\ Type

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` The name of the attribute. |
| `↳ value` | `string` The value of the attribute. If `value` is not empty, `group_values` must be empty. |
| `↳ group_values` | `array<https://docs.cloud.google.com/php/docs/reference/shopping-common-protos/latest/Type.CustomAttribute>` Subattributes within this attribute group. If `group_values` is not empty, `value` must be empty. |

### getName

The name of the attribute.

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

### hasName

### clearName

### setName

The name of the attribute.

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

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

### getValue

The value of the attribute. If `value` is not empty, `group_values` must be
empty.

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

### hasValue

### clearValue

### setValue

The value of the attribute. If `value` is not empty, `group_values` must be
empty.

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

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

### getGroupValues

Subattributes within this attribute group. If
`group_values` is not empty, `value` must be empty.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/shopping-common-protos/latest/Type.CustomAttribute>` |   |

### setGroupValues

Subattributes within this attribute group. If
`group_values` is not empty, `value` must be empty.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/shopping-common-protos/latest/Type.CustomAttribute>` |

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