id = $id; $this->userId = $userId; $this->mailAddress = $mailAddress; $this->createdAt = $createdAt; $this->modifiedAt = $modifiedAt; } public static function createFromArray(array $data): self { return new self( (int)$data['alias_id'], (int)$data['user_id'], $data['mail_address'], new DateTimeImmutable($data['created_at']), new DateTimeImmutable($data['modified_at']), ); } public function getId(): int { return $this->id; } public function getUserId(): int { return $this->userId; } public function getMailAddress(): string { return $this->mailAddress; } public function getCreatedAt(): DateTimeImmutable { return $this->createdAt; } public function getModifiedAt(): DateTimeImmutable { return $this->modifiedAt; } }