# new ListItem()

> Create a new ListItem

- Source: `src/ListItem.php#L49` <https://github.com/wagnerwagner/merx/blob/2.0.0-alpha.11/src/ListItem.php#L49>

```php
new ListItem(string $key, null|string $title = null, Kirby\Cms\Page|string|null $page = null, Wagnerwagner\Merx\Price|float|null $price = null, float $quantity = 1, null|float $quantifier = null, null|string $type = 'product', null|array $data = null, bool $refreshPrice = true)
```

## Parameters

| Name | Type | Default |
| --- | --- | --- |
| `$key` | `string` | `–` |
| `$title` | `null\|string` | `null` |
| `$page` | `Kirby\Cms\Page\|string\|null` | `null` |
| `$price` | `Wagnerwagner\Merx\Price\|float\|null` | `null` |
| `$quantity` | `float` | `1` |
| `$quantifier` | `null\|float` | `null` |
| `$type` | `null\|string` | `'product'` |
| `$data` | `null\|array` | `null` |
| `$refreshPrice` | `bool` | `true` |

## Exceptions

| Type | Description |
| --- | --- |
| `InvalidArgumentException` | when $type is not in ListItem::$allowedTypes. |

## Parent class

`Wagnerwagner\Merx\ListItem`
