| 1 | <?php |
||
| 9 | class MetaData |
||
| 10 | { |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var \DateTimeImmutable |
||
| 14 | */ |
||
| 15 | private $dateCreated; |
||
| 16 | |||
| 17 | private $aggregateId; |
||
| 18 | private $authenticatedUserId; |
||
| 19 | |||
| 20 | /* @var string */ |
||
| 21 | private $aggregateClass; |
||
| 22 | |||
| 23 | 18 | public function __construct( |
|
| 24 | $aggregateId, |
||
| 25 | string $aggregateClass, |
||
| 26 | \DateTimeImmutable $dateCreated, |
||
| 27 | $authenticatedUserId = null |
||
| 28 | ) |
||
| 29 | { |
||
| 30 | 18 | $this->dateCreated = $this->addTimeZone($dateCreated); |
|
| 31 | 18 | $this->aggregateId = $aggregateId; |
|
| 32 | 18 | $this->authenticatedUserId = $authenticatedUserId; |
|
| 33 | 18 | $this->aggregateClass = $aggregateClass; |
|
| 34 | 18 | } |
|
| 35 | |||
| 36 | 1 | public function getDateCreated(): \DateTimeImmutable |
|
| 40 | |||
| 41 | 2 | public function getAggregateId() |
|
| 45 | |||
| 46 | 2 | public function getAggregateClass() |
|
| 50 | |||
| 51 | 1 | public function getAuthenticatedUserId() |
|
| 55 | |||
| 56 | 18 | private function addTimeZone(\DateTimeImmutable $dateCreated): \DateTimeImmutable |
|
| 61 | } |