PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.27
Booking for Appointments and Events Calendar – Amelia v1.2.27
2.4.5 2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / src / Domain / Entity / Booking / AbstractBooking.php
ameliabooking / src / Domain / Entity / Booking Last commit date
Appointment 1 year ago Event 1 year ago AbstractBooking.php 1 year ago AbstractCustomerBooking.php 1 year ago Reservation.php 1 year ago SlotsEntities.php 1 year ago
AbstractBooking.php
141 lines
1 <?php
2
3 /**
4 * @copyright © TMS-Plugins. All rights reserved.
5 * @licence See LICENCE.md for license details.
6 */
7
8 namespace AmeliaBooking\Domain\Entity\Booking;
9
10 use AmeliaBooking\Domain\Collection\Collection;
11 use AmeliaBooking\Domain\ValueObjects\String\BookingStatus;
12 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
13 use AmeliaBooking\Domain\ValueObjects\String\Description;
14
15 /**
16 * Class AbstractBooking
17 *
18 * @package AmeliaBooking\Domain\Entity\Booking
19 */
20 abstract class AbstractBooking
21 {
22 /** @var Id */
23 private $id;
24
25 /** @var Collection */
26 protected $bookings;
27
28 /** @var bool */
29 protected $notifyParticipants;
30
31 /** @var Description */
32 protected $internalNotes;
33
34 /** @var BookingStatus */
35 protected $status;
36
37 /**
38 * AbstractBooking constructor.
39 *
40 * @param boolean $notifyParticipants
41 */
42 public function __construct($notifyParticipants)
43 {
44 $this->notifyParticipants = $notifyParticipants;
45 }
46
47 /**
48 * @return Id
49 */
50 public function getId()
51 {
52 return $this->id;
53 }
54
55 /**
56 * @param Id $id
57 */
58 public function setId(Id $id)
59 {
60 $this->id = $id;
61 }
62
63 /**
64 * @return Collection
65 */
66 public function getBookings()
67 {
68 return $this->bookings;
69 }
70
71 /**
72 * @param Collection $bookings
73 */
74 public function setBookings(Collection $bookings)
75 {
76 $this->bookings = $bookings;
77 }
78
79 /**
80 * @return bool
81 */
82 public function isNotifyParticipants()
83 {
84 return $this->notifyParticipants;
85 }
86
87 /**
88 * @param bool $notifyParticipants
89 */
90 public function setNotifyParticipants($notifyParticipants)
91 {
92 $this->notifyParticipants = $notifyParticipants;
93 }
94
95 /**
96 * @return Description
97 */
98 public function getInternalNotes()
99 {
100 return $this->internalNotes;
101 }
102
103 /**
104 * @param Description $internalNotes
105 */
106 public function setInternalNotes(Description $internalNotes)
107 {
108 $this->internalNotes = $internalNotes;
109 }
110
111 /**
112 * @return BookingStatus
113 */
114 public function getStatus()
115 {
116 return $this->status;
117 }
118
119 /**
120 * @param BookingStatus $status
121 */
122 public function setStatus(BookingStatus $status)
123 {
124 $this->status = $status;
125 }
126
127 /**
128 * @return array
129 */
130 public function toArray()
131 {
132 return [
133 'id' => null !== $this->getId() ? $this->getId()->getValue() : null,
134 'bookings' => null !== $this->getBookings() ? $this->getBookings()->toArray() : null,
135 'notifyParticipants' => $this->isNotifyParticipants(),
136 'internalNotes' => null !== $this->getInternalNotes() ? $this->getInternalNotes()->getValue() : null,
137 'status' => $this->getStatus() ? $this->getStatus()->getValue() : null,
138 ];
139 }
140 }
141