| 1 | <?php |
||
| 11 | final class DoSomething implements Command |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var PointInTime |
||
| 15 | */ |
||
| 16 | private $timeOfRequest; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var AggregateRootId |
||
| 20 | */ |
||
| 21 | private $aggregateRootId; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | private $reason; |
||
| 27 | |||
| 28 | public function __construct( |
||
| 29 | AggregateRootId $aggregateRootId, |
||
| 30 | PointInTime $timeOfRequest, |
||
| 31 | string $reason |
||
| 32 | ) { |
||
| 33 | $this->aggregateRootId = $aggregateRootId; |
||
| 34 | $this->timeOfRequest = $timeOfRequest; |
||
| 35 | $this->reason = $reason; |
||
| 36 | } |
||
| 37 | |||
| 38 | public function timeOfRequest(): PointInTime |
||
| 39 | { |
||
| 40 | return $this->timeOfRequest; |
||
| 41 | } |
||
| 42 | |||
| 43 | public function aggregateRootId(): AggregateRootId |
||
| 44 | { |
||
| 45 | return $this->aggregateRootId; |
||
| 46 | } |
||
| 47 | |||
| 48 | public function reason(): string |
||
| 49 | { |
||
| 50 | return $this->reason; |
||
| 51 | } |
||
| 52 | |||
| 53 | } |
||
| 54 | |||
| 55 |