PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.32
Booking for Appointments and Events Calendar – Amelia v1.2.32
2.4.9 2.4.8 2.4.7 2.4.6 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 / CustomField / CustomFieldOption.php
ameliabooking / src / Domain / Entity / CustomField Last commit date
CustomField.php 1 year ago CustomFieldOption.php 1 year ago
CustomFieldOption.php
145 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\CustomField;
9
10 use AmeliaBooking\Domain\ValueObjects\Json;
11 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
12 use AmeliaBooking\Domain\ValueObjects\Number\Integer\IntegerValue;
13 use AmeliaBooking\Domain\ValueObjects\String\Label;
14
15 /**
16 * Class CustomFieldOption
17 *
18 * @package AmeliaBooking\Domain\Entity\CustomField
19 */
20 class CustomFieldOption
21 {
22 /** @var Id */
23 private $id;
24
25 /** @var Id */
26 private $customFieldId;
27
28 /** @var Label */
29 private $label;
30
31 /** @var IntegerValue */
32 private $position;
33
34 /** @var Json */
35 private $translations;
36
37 /**
38 * CustomFieldOption constructor.
39 *
40 * @param Id $customFieldId
41 * @param Label $label
42 * @param IntegerValue $position
43 */
44 public function __construct(Id $customFieldId, Label $label, IntegerValue $position)
45 {
46 $this->customFieldId = $customFieldId;
47 $this->label = $label;
48 $this->position = $position;
49 }
50
51 /**
52 * @return Id
53 */
54 public function getId()
55 {
56 return $this->id;
57 }
58
59 /**
60 * @param Id $id
61 */
62 public function setId($id)
63 {
64 $this->id = $id;
65 }
66
67 /**
68 * @return Id
69 */
70 public function getCustomFieldId()
71 {
72 return $this->customFieldId;
73 }
74
75 /**
76 * @param Id $customFieldId
77 */
78 public function setCustomFieldId($customFieldId)
79 {
80 $this->customFieldId = $customFieldId;
81 }
82
83 /**
84 * @return Label
85 */
86 public function getLabel()
87 {
88 return $this->label;
89 }
90
91 /**
92 * @param Label $label
93 */
94 public function setLabel($label)
95 {
96 $this->label = $label;
97 }
98
99 /**
100 * @return IntegerValue
101 */
102 public function getPosition()
103 {
104 return $this->position;
105 }
106
107 /**
108 * @param IntegerValue $position
109 */
110 public function setPosition($position)
111 {
112 $this->position = $position;
113 }
114
115 /**
116 * @return Json
117 */
118 public function getTranslations()
119 {
120 return $this->translations;
121 }
122
123 /**
124 * @param Json $translations
125 */
126 public function setTranslations(Json $translations)
127 {
128 $this->translations = $translations;
129 }
130
131 /**
132 * @return array
133 */
134 public function toArray()
135 {
136 return [
137 'id' => null !== $this->getId() ? $this->getId()->getValue() : null,
138 'customFieldId' => $this->getCustomFieldId()->getValue(),
139 'label' => $this->getLabel()->getValue(),
140 'position' => $this->getPosition()->getValue(),
141 'translations' => $this->getTranslations() ? $this->getTranslations()->getValue() : null,
142 ];
143 }
144 }
145