PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.11
Booking for Appointments and Events Calendar – Amelia v1.2.11
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 / Bookable / AbstractExtra.php
ameliabooking / src / Domain / Entity / Bookable Last commit date
Service 2 years ago AbstractBookable.php 2 years ago AbstractCategory.php 2 years ago AbstractExtra.php 2 years ago
AbstractExtra.php
148 lines
1 <?php
2
3 namespace AmeliaBooking\Domain\Entity\Bookable;
4
5 use AmeliaBooking\Domain\ValueObjects\Number\Float\Price;
6 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
7 use AmeliaBooking\Domain\ValueObjects\Number\Integer\PositiveInteger;
8 use AmeliaBooking\Domain\ValueObjects\String\Description;
9 use AmeliaBooking\Domain\ValueObjects\String\Name;
10
11 /**
12 * Class AbstractExtra
13 *
14 * @package AmeliaBooking\Domain\Entity\Bookable
15 */
16 abstract class AbstractExtra
17 {
18 /** @var Id */
19 private $id;
20
21 /** @var Name */
22 protected $name;
23
24 /** @var Description */
25 protected $description;
26
27 /** @var Price */
28 protected $price;
29
30 /** @var PositiveInteger */
31 protected $maxQuantity;
32
33 /** @var PositiveInteger */
34 protected $position;
35
36 /**
37 * @return Id
38 */
39 public function getId()
40 {
41 return $this->id;
42 }
43
44 /**
45 * @param Id $id
46 */
47 public function setId(Id $id)
48 {
49 $this->id = $id;
50 }
51
52 /**
53 * @return Name
54 */
55 public function getName()
56 {
57 return $this->name;
58 }
59
60 /**
61 * @param Name $name
62 */
63 public function setName(Name $name)
64 {
65 $this->name = $name;
66 }
67
68 /**
69 * @return Description
70 */
71 public function getDescription()
72 {
73 return $this->description;
74 }
75
76 /**
77 * @param Description $description
78 */
79 public function setDescription(Description $description)
80 {
81 $this->description = $description;
82 }
83
84 /**
85 * @return Price
86 */
87 public function getPrice()
88 {
89 return $this->price;
90 }
91
92 /**
93 * @param Price $price
94 */
95 public function setPrice(Price $price)
96 {
97 $this->price = $price;
98 }
99
100 /**
101 * @return PositiveInteger
102 */
103 public function getMaxQuantity()
104 {
105 return $this->maxQuantity;
106 }
107
108 /**
109 * @param PositiveInteger $maxQuantity
110 */
111 public function setMaxQuantity(PositiveInteger $maxQuantity)
112 {
113 $this->maxQuantity = $maxQuantity;
114 }
115
116 /**
117 * @return PositiveInteger
118 */
119 public function getPosition()
120 {
121 return $this->position;
122 }
123
124 /**
125 * @param PositiveInteger $position
126 */
127 public function setPosition(PositiveInteger $position)
128 {
129 $this->position = $position;
130 }
131
132 /**
133 * @return array
134 */
135 public function toArray()
136 {
137 return [
138 'id' => null !== $this->getId() ? $this->getId()->getValue() : null,
139 'name' => $this->getName() ? $this->getName()->getValue() : null,
140 'description' => $this->getDescription() ? $this->getDescription()->getValue() : null,
141 'price' => $this->getPrice() ? $this->getPrice()->getValue() : null,
142 'maxQuantity' => $this->getMaxQuantity() ? $this->getMaxQuantity()->getValue() : null,
143 'position' => $this->getPosition() ? $this->getPosition()->getValue() : null,
144 'type' => $this->getType() ? $this->getType()->getValue() : null,
145 ];
146 }
147 }
148