| 1 | <?php declare(strict_types=1); |
||
| 10 | class BaseEvent implements Event |
||
| 11 | { |
||
| 12 | protected int $id; |
||
|
|
|||
| 13 | |||
| 14 | protected Type $type; |
||
| 15 | |||
| 16 | protected Information $information; |
||
| 17 | |||
| 18 | protected Ring $ring; |
||
| 19 | |||
| 20 | protected BaseSound $sound; |
||
| 21 | |||
| 22 | 23 | public function __construct(int $id, Type $type, Information $information, Ring $ring, BaseSound $sound) |
|
| 23 | { |
||
| 24 | 23 | $this->id = $id; |
|
| 25 | 23 | $this->type = $type; |
|
| 26 | 23 | $this->information = $information; |
|
| 27 | 23 | $this->ring = $ring; |
|
| 28 | 23 | $this->sound = $sound; |
|
| 29 | } |
||
| 30 | |||
| 31 | 21 | public function getAsArray(): array |
|
| 32 | { |
||
| 33 | return [ |
||
| 34 | 21 | 'id' => $this->id, |
|
| 35 | 21 | 'type' => $this->type->getValue(), |
|
| 36 | 21 | 'information' => $this->information->getAsArray(), |
|
| 37 | 21 | 'ring' => $this->ring->getAsArray(), |
|
| 38 | 21 | 'sound' => $this->sound->getAsArray(), |
|
| 39 | ]; |
||
| 40 | } |
||
| 41 | } |
||
| 42 |