OutlookCalendar.php
100 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AmeliaBooking\Domain\Entity\Outlook; |
| 4 | |
| 5 | use AmeliaBooking\Domain\ValueObjects\String\Email; |
| 6 | use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id; |
| 7 | use AmeliaBooking\Domain\ValueObjects\String\Label; |
| 8 | use AmeliaBooking\Domain\ValueObjects\String\Token; |
| 9 | |
| 10 | /** |
| 11 | * Class OutlookCalendar |
| 12 | * |
| 13 | * @package AmeliaBooking\Domain\Entity\Outlook |
| 14 | */ |
| 15 | class OutlookCalendar |
| 16 | { |
| 17 | /** @var Id */ |
| 18 | private $id; |
| 19 | |
| 20 | /** @var Token */ |
| 21 | private $token; |
| 22 | |
| 23 | /** @var Label */ |
| 24 | private $calendarId; |
| 25 | |
| 26 | /** |
| 27 | * OutlookCalendar constructor. |
| 28 | * |
| 29 | * @param Token $token |
| 30 | * @param Label $calendarId |
| 31 | */ |
| 32 | public function __construct( |
| 33 | Token $token, |
| 34 | Label $calendarId |
| 35 | ) { |
| 36 | $this->token = $token; |
| 37 | $this->calendarId = $calendarId; |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * @return Id |
| 42 | */ |
| 43 | public function getId() |
| 44 | { |
| 45 | return $this->id; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * @param Id $id |
| 50 | */ |
| 51 | public function setId($id) |
| 52 | { |
| 53 | $this->id = $id; |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * @return Token |
| 58 | */ |
| 59 | public function getToken() |
| 60 | { |
| 61 | return $this->token; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * @param Token $token |
| 66 | */ |
| 67 | public function setToken($token) |
| 68 | { |
| 69 | $this->token = $token; |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * @return Label |
| 74 | */ |
| 75 | public function getCalendarId() |
| 76 | { |
| 77 | return $this->calendarId; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * @param Label $calendarId |
| 82 | */ |
| 83 | public function setCalendarId($calendarId) |
| 84 | { |
| 85 | $this->calendarId = $calendarId; |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * @return array |
| 90 | */ |
| 91 | public function toArray() |
| 92 | { |
| 93 | return [ |
| 94 | 'id' => null !== $this->getId() ? $this->getId()->getValue() : null, |
| 95 | 'token' => $this->getToken()->getValue(), |
| 96 | 'calendarId' => null !== $this->getCalendarId() ? $this->getCalendarId()->getValue() : null, |
| 97 | ]; |
| 98 | } |
| 99 | } |
| 100 |