| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* @copyright © Melograno Venture Studio. All rights reserved. |
| 5 |
* @licence See LICENCE.md for license details. |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace IvyForms\Entity\Notification; |
| 9 |
|
| 10 |
use IvyForms\ValueObjects\Notification\NotificationContact as NotificationContactValueObject; |
| 11 |
|
| 12 |
/** |
| 13 |
* Class NotificationContact |
| 14 |
* |
| 15 |
* Entity wrapper for NotificationContact ValueObject. |
| 16 |
* |
| 17 |
* @package IvyForms\Entity\Notification |
| 18 |
*/ |
| 19 |
class NotificationContact |
| 20 |
{ |
| 21 |
/** |
| 22 |
* @var NotificationContactValueObject |
| 23 |
*/ |
| 24 |
private NotificationContactValueObject $notificationContact; |
| 25 |
|
| 26 |
/** |
| 27 |
* @param NotificationContactValueObject $notificationContact |
| 28 |
*/ |
| 29 |
public function __construct(NotificationContactValueObject $notificationContact) |
| 30 |
{ |
| 31 |
$this->notificationContact = $notificationContact; |
| 32 |
} |
| 33 |
|
| 34 |
/** |
| 35 |
* Get the notification sender. |
| 36 |
* |
| 37 |
* @return string |
| 38 |
*/ |
| 39 |
public function getSender(): string |
| 40 |
{ |
| 41 |
return $this->notificationContact->getSender(); |
| 42 |
} |
| 43 |
|
| 44 |
/** |
| 45 |
* Set the notification sender. |
| 46 |
* |
| 47 |
* @param string $sender |
| 48 |
*/ |
| 49 |
public function setSender(string $sender): void |
| 50 |
{ |
| 51 |
$this->notificationContact->setSender($sender); |
| 52 |
} |
| 53 |
|
| 54 |
/** |
| 55 |
* Get the notification receiver. |
| 56 |
* |
| 57 |
* @return string |
| 58 |
*/ |
| 59 |
public function getReceiver(): string |
| 60 |
{ |
| 61 |
return $this->notificationContact->getReceiver(); |
| 62 |
} |
| 63 |
|
| 64 |
/** |
| 65 |
* Set the notification receiver. |
| 66 |
* |
| 67 |
* @param string $receiver |
| 68 |
*/ |
| 69 |
public function setReceiver(string $receiver): void |
| 70 |
{ |
| 71 |
$this->notificationContact->setReceiver($receiver); |
| 72 |
} |
| 73 |
|
| 74 |
/** |
| 75 |
* Get the notification reply-to address. |
| 76 |
* |
| 77 |
* @return string |
| 78 |
*/ |
| 79 |
public function getReplyTo(): string |
| 80 |
{ |
| 81 |
return $this->notificationContact->getReplyTo(); |
| 82 |
} |
| 83 |
|
| 84 |
/** |
| 85 |
* Set the notification reply-to address. |
| 86 |
* |
| 87 |
* @param string $replyTo |
| 88 |
*/ |
| 89 |
public function setReplyTo(string $replyTo): void |
| 90 |
{ |
| 91 |
$this->notificationContact->setReplyTo($replyTo); |
| 92 |
} |
| 93 |
|
| 94 |
/** |
| 95 |
* Convert contact information to array. |
| 96 |
* |
| 97 |
* @return array<string, string> |
| 98 |
*/ |
| 99 |
public function toArray(): array |
| 100 |
{ |
| 101 |
return $this->notificationContact->toArray(); |
| 102 |
} |
| 103 |
} |
| 104 |
|