PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.20
Booking for Appointments and Events Calendar – Amelia v1.2.20
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 3 years ago AbstractCustomerBooking.php 2 years ago Reservation.php 2 years ago SlotsEntities.php 3 years ago
AbstractBooking.php
139 lines
1 <?php
2 /**
3 * @copyright © TMS-Plugins. All rights reserved.
4 * @licence See LICENCE.md for license details.
5 */
6
7 namespace AmeliaBooking\Domain\Entity\Booking;
8
9 use AmeliaBooking\Domain\Collection\Collection;
10 use AmeliaBooking\Domain\ValueObjects\String\BookingStatus;
11 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
12 use AmeliaBooking\Domain\ValueObjects\String\Description;
13
14 /**
15 * Class AbstractBooking
16 *
17 * @package AmeliaBooking\Domain\Entity\Booking
18 */
19 abstract class AbstractBooking
20 {
21 /** @var Id */
22 private $id;
23
24 /** @var Collection */
25 protected $bookings;
26
27 /** @var bool */
28 protected $notifyParticipants;
29
30 /** @var Description */
31 protected $internalNotes;
32
33 /** @var BookingStatus */
34 protected $status;
35
36 /**
37 * AbstractBooking constructor.
38 *
39 * @param boolean $notifyParticipants
40 */
41 public function __construct($notifyParticipants) {
42 $this->notifyParticipants = $notifyParticipants;
43 }
44
45 /**
46 * @return Id
47 */
48 public function getId()
49 {
50 return $this->id;
51 }
52
53 /**
54 * @param Id $id
55 */
56 public function setId(Id $id)
57 {
58 $this->id = $id;
59 }
60
61 /**
62 * @return Collection
63 */
64 public function getBookings()
65 {
66 return $this->bookings;
67 }
68
69 /**
70 * @param Collection $bookings
71 */
72 public function setBookings(Collection $bookings)
73 {
74 $this->bookings = $bookings;
75 }
76
77 /**
78 * @return bool
79 */
80 public function isNotifyParticipants()
81 {
82 return $this->notifyParticipants;
83 }
84
85 /**
86 * @param bool $notifyParticipants
87 */
88 public function setNotifyParticipants($notifyParticipants)
89 {
90 $this->notifyParticipants = $notifyParticipants;
91 }
92
93 /**
94 * @return Description
95 */
96 public function getInternalNotes()
97 {
98 return $this->internalNotes;
99 }
100
101 /**
102 * @param Description $internalNotes
103 */
104 public function setInternalNotes(Description $internalNotes)
105 {
106 $this->internalNotes = $internalNotes;
107 }
108
109 /**
110 * @return BookingStatus
111 */
112 public function getStatus()
113 {
114 return $this->status;
115 }
116
117 /**
118 * @param BookingStatus $status
119 */
120 public function setStatus(BookingStatus $status)
121 {
122 $this->status = $status;
123 }
124
125 /**
126 * @return array
127 */
128 public function toArray()
129 {
130 return [
131 'id' => null !== $this->getId() ? $this->getId()->getValue() : null,
132 'bookings' => null !== $this->getBookings() ? $this->getBookings()->toArray() : null,
133 'notifyParticipants' => $this->isNotifyParticipants(),
134 'internalNotes' => null !== $this->getInternalNotes() ? $this->getInternalNotes()->getValue() : null,
135 'status' => $this->getStatus() ? $this->getStatus()->getValue() : null,
136 ];
137 }
138 }
139