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 / Bookable / Service / Extra.php
ameliabooking / src / Domain / Entity / Bookable / Service Last commit date
Category.php 7 years ago Extra.php 2 years ago Package.php 2 years ago PackageCustomer.php 2 years ago PackageCustomerService.php 5 years ago PackageService.php 2 years ago Resource.php 2 years ago Service.php 2 years ago
Extra.php
121 lines
1 <?php
2
3 namespace AmeliaBooking\Domain\Entity\Bookable\Service;
4
5 use AmeliaBooking\Domain\Entity\Bookable\AbstractExtra;
6 use AmeliaBooking\Domain\Entity\Entities;
7 use AmeliaBooking\Domain\ValueObjects\BooleanValueObject;
8 use AmeliaBooking\Domain\ValueObjects\Json;
9 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
10 use AmeliaBooking\Domain\ValueObjects\Duration;
11 use AmeliaBooking\Domain\ValueObjects\String\BookableType;
12
13 /**
14 * Class Extra
15 *
16 * @package AmeliaBooking\Domain\Entity\Bookable\Service
17 */
18 class Extra extends AbstractExtra
19 {
20
21 /** @var Duration */
22 private $duration;
23
24 /** @var Id */
25 private $serviceId;
26
27 /** @var BooleanValueObject */
28 protected $aggregatedPrice;
29
30 /** @var Json */
31 private $translations;
32
33 /**
34 * @return Duration
35 */
36 public function getDuration()
37 {
38 return $this->duration;
39 }
40
41 /**
42 * @param Duration $duration
43 */
44 public function setDuration(Duration $duration)
45 {
46 $this->duration = $duration;
47 }
48
49 /**
50 * @return Id
51 */
52 public function getServiceId()
53 {
54 return $this->serviceId;
55 }
56
57 /**
58 * @param Id $serviceId
59 */
60 public function setServiceId(Id $serviceId)
61 {
62 $this->serviceId = $serviceId;
63 }
64
65 /**
66 * @return BooleanValueObject
67 */
68 public function getAggregatedPrice()
69 {
70 return $this->aggregatedPrice;
71 }
72
73 /**
74 * @param BooleanValueObject $aggregatedPrice
75 */
76 public function setAggregatedPrice(BooleanValueObject $aggregatedPrice)
77 {
78 $this->aggregatedPrice = $aggregatedPrice;
79 }
80
81 /**
82 * @return Json
83 */
84 public function getTranslations()
85 {
86 return $this->translations;
87 }
88
89 /**
90 * @param Json $translations
91 */
92 public function setTranslations(Json $translations)
93 {
94 $this->translations = $translations;
95 }
96
97 /**
98 * @return BookableType
99 */
100 public function getType()
101 {
102 return new BookableType(Entities::EXTRA);
103 }
104
105 /**
106 * @return array
107 */
108 public function toArray()
109 {
110 return array_merge(
111 parent::toArray(),
112 [
113 'duration' => $this->getDuration() ? $this->getDuration()->getValue() : null,
114 'serviceId' => $this->getServiceId() ? $this->getServiceId()->getValue() : null,
115 'aggregatedPrice' => $this->getAggregatedPrice() ? $this->getAggregatedPrice()->getValue() : null,
116 'translations' => $this->getTranslations() ? $this->getTranslations()->getValue() : null,
117 ]
118 );
119 }
120 }
121