# $pricingRules->set()

> Adds a new element to the collection

- Source: `src/Toolkit/Collection.php#L924` <https://github.com/getkirby/kirby/blob/6.0.0-beta.1/src/Toolkit/Collection.php#L924>
- Inherited from Kirby, not part of the Merx API. See <https://getkirby.com/docs/reference>.

```php
$pricingRules->set(array|string $key, TValue|null $value = null): Kirby\Toolkit\Collection
```

## Parameters

| Name | Type | Default |
| --- | --- | --- |
| `$key` | `array\|string` | `–` |
| `$value` | `TValue\|null` | `null` |

## Return type

`Kirby\Toolkit\Collection`

## Parent class

`Wagnerwagner\Merx\PricingRules` inherited from `Kirby\Toolkit\Collection`
