OutlookCalendar.php
184 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 | /** @var bool */ |
| 27 | private $insertPendingAppointments; |
| 28 | |
| 29 | /** @var bool */ |
| 30 | private $includeBufferTime; |
| 31 | |
| 32 | /** @var array */ |
| 33 | private $title; |
| 34 | |
| 35 | /** @var array */ |
| 36 | private $description; |
| 37 | |
| 38 | /** |
| 39 | * OutlookCalendar constructor. |
| 40 | * |
| 41 | * @param Token $token |
| 42 | * @param Label $calendarId |
| 43 | */ |
| 44 | public function __construct( |
| 45 | Token $token, |
| 46 | Label $calendarId |
| 47 | ) { |
| 48 | $this->token = $token; |
| 49 | $this->calendarId = $calendarId; |
| 50 | $this->insertPendingAppointments = false; |
| 51 | $this->includeBufferTime = false; |
| 52 | $this->title = ['appointment' => '', 'event' => '']; |
| 53 | $this->description = ['appointment' => '', 'event' => '']; |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * @return Id |
| 58 | */ |
| 59 | public function getId() |
| 60 | { |
| 61 | return $this->id; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * @param Id $id |
| 66 | */ |
| 67 | public function setId($id) |
| 68 | { |
| 69 | $this->id = $id; |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * @return Token |
| 74 | */ |
| 75 | public function getToken() |
| 76 | { |
| 77 | return $this->token; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * @param Token $token |
| 82 | */ |
| 83 | public function setToken($token) |
| 84 | { |
| 85 | $this->token = $token; |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * @return Label |
| 90 | */ |
| 91 | public function getCalendarId() |
| 92 | { |
| 93 | return $this->calendarId; |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * @param Label $calendarId |
| 98 | */ |
| 99 | public function setCalendarId($calendarId) |
| 100 | { |
| 101 | $this->calendarId = $calendarId; |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * @return bool |
| 106 | */ |
| 107 | public function getInsertPendingAppointments() |
| 108 | { |
| 109 | return $this->insertPendingAppointments; |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * @param bool $insertPendingAppointments |
| 114 | */ |
| 115 | public function setInsertPendingAppointments($insertPendingAppointments) |
| 116 | { |
| 117 | $this->insertPendingAppointments = $insertPendingAppointments; |
| 118 | } |
| 119 | |
| 120 | /** |
| 121 | * @return bool |
| 122 | */ |
| 123 | public function getIncludeBufferTime() |
| 124 | { |
| 125 | return $this->includeBufferTime; |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * @param bool $includeBufferTime |
| 130 | */ |
| 131 | public function setIncludeBufferTime($includeBufferTime) |
| 132 | { |
| 133 | $this->includeBufferTime = $includeBufferTime; |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * @return array |
| 138 | */ |
| 139 | public function getTitle() |
| 140 | { |
| 141 | return $this->title; |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * @param array $title |
| 146 | */ |
| 147 | public function setTitle($title) |
| 148 | { |
| 149 | $this->title = $title; |
| 150 | } |
| 151 | |
| 152 | /** |
| 153 | * @return array |
| 154 | */ |
| 155 | public function getDescription() |
| 156 | { |
| 157 | return $this->description; |
| 158 | } |
| 159 | |
| 160 | /** |
| 161 | * @param array $description |
| 162 | */ |
| 163 | public function setDescription($description) |
| 164 | { |
| 165 | $this->description = $description; |
| 166 | } |
| 167 | |
| 168 | /** |
| 169 | * @return array |
| 170 | */ |
| 171 | public function toArray() |
| 172 | { |
| 173 | return [ |
| 174 | 'id' => null !== $this->getId() ? $this->getId()->getValue() : null, |
| 175 | 'token' => $this->getToken()->getValue(), |
| 176 | 'calendarId' => null !== $this->getCalendarId() ? $this->getCalendarId()->getValue() : null, |
| 177 | 'insertPendingAppointments' => $this->getInsertPendingAppointments(), |
| 178 | 'includeBufferTime' => $this->getIncludeBufferTime(), |
| 179 | 'title' => $this->getTitle(), |
| 180 | 'description' => $this->getDescription(), |
| 181 | ]; |
| 182 | } |
| 183 | } |
| 184 |