| 1 | <?php |
||
| 14 | class Item extends BaseItem implements CreatableFromArray |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var int count |
||
| 18 | */ |
||
| 19 | private $count; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var int |
||
| 23 | */ |
||
| 24 | private $discount; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @return int |
||
| 28 | */ |
||
| 29 | public function getCount(): int |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param int $count |
||
| 36 | * |
||
| 37 | * @return Item |
||
| 38 | */ |
||
| 39 | 2 | public function withCount(int $count) |
|
| 46 | |||
| 47 | /** |
||
| 48 | * @return int |
||
| 49 | */ |
||
| 50 | public function getDiscount(): int |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param int $discount |
||
| 57 | * |
||
| 58 | * @return Item |
||
| 59 | */ |
||
| 60 | 2 | public function withDiscount(int $discount) |
|
| 67 | |||
| 68 | 2 | public function toArray() |
|
| 80 | |||
| 81 | 3 | public static function createFromArray(array $data) |
|
| 96 | } |
||
| 97 |