PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / trunk
Booking for Appointments and Events Calendar – Amelia vtrunk
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 / Schedule / TimeOut.php
ameliabooking / src / Domain / Entity / Schedule Last commit date
BlockTime.php 2 months ago DayOff.php 2 months ago Period.php 6 months ago PeriodLocation.php 6 months ago PeriodService.php 6 months ago SpecialDay.php 6 months ago SpecialDayPeriod.php 6 months ago SpecialDayPeriodLocation.php 6 months ago SpecialDayPeriodService.php 6 months ago TimeOut.php 6 months ago WeekDay.php 6 months ago
TimeOut.php
103 lines
1 <?php
2
3 /**
4 * @copyright © Melograno Ventures. All rights reserved.
5 * @licence See LICENCE.md for license details.
6 */
7
8 namespace AmeliaBooking\Domain\Entity\Schedule;
9
10 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
11 use AmeliaBooking\Domain\ValueObjects\DateTime\DateTimeValue;
12
13 /**
14 * Class TimeOut
15 *
16 * @package AmeliaBooking\Domain\Entity\Schedule
17 */
18 class TimeOut
19 {
20 /** @var Id */
21 private $id;
22
23 /** @var DateTimeValue */
24 private $startTime;
25
26 /** @var DateTimeValue */
27 private $endTime;
28
29 /**
30 * TimeOut constructor.
31 *
32 * @param DateTimeValue $startTime
33 * @param DateTimeValue $endTime
34 */
35 public function __construct(
36 DateTimeValue $startTime,
37 DateTimeValue $endTime
38 ) {
39 $this->startTime = $startTime;
40 $this->endTime = $endTime;
41 }
42
43 /**
44 * @return Id
45 */
46 public function getId()
47 {
48 return $this->id;
49 }
50
51 /**
52 * @param Id $id
53 */
54 public function setId(Id $id)
55 {
56 $this->id = $id;
57 }
58
59 /**
60 * @return DateTimeValue
61 */
62 public function getStartTime()
63 {
64 return $this->startTime;
65 }
66
67 /**
68 * @param DateTimeValue $startTime
69 */
70 public function setStartTime(DateTimeValue $startTime)
71 {
72 $this->startTime = $startTime;
73 }
74
75 /**
76 * @return DateTimeValue
77 */
78 public function getEndTime()
79 {
80 return $this->endTime;
81 }
82
83 /**
84 * @param DateTimeValue $endTime
85 */
86 public function setEndTime(DateTimeValue $endTime)
87 {
88 $this->endTime = $endTime;
89 }
90
91 /**
92 * @return array
93 */
94 public function toArray()
95 {
96 return [
97 'id' => null !== $this->getId() ? $this->getId()->getValue() : null,
98 'startTime' => $this->startTime->getValue()->format('H:i:s'),
99 'endTime' => $this->endTime->getValue()->format('H:i:s'),
100 ];
101 }
102 }
103