<?php
 namespace Eluceo\iCal\Domain\ValueObject; final class Organizer { private EmailAddress $emailAddress; private ?string $displayName; private ?EmailAddress $sentBy; private ?Uri $directoryEntry; public function __construct( EmailAddress $emailAddress, ?string $displayName = null, ?Uri $directoryEntry = null, ?EmailAddress $sentBy = null ) { $this->emailAddress = $emailAddress; $this->displayName = $displayName; $this->directoryEntry = $directoryEntry; $this->sentBy = $sentBy; } public function getEmailAddress(): EmailAddress { return $this->emailAddress; } public function hasDisplayName(): bool { return $this->displayName !== null; } public function getDisplayName(): string { assert($this->displayName !== null); return $this->displayName; } public function isSentInBehalfOf(): bool { return $this->sentBy !== null; } public function getSentBy(): EmailAddress { assert($this->sentBy !== null); return $this->sentBy; } public function hasDirectoryEntry(): bool { return $this->directoryEntry !== null; } public function getDirectoryEntry(): Uri { assert($this->directoryEntry !== null); return $this->directoryEntry; } } 