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