PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.3
Booktics – Appointment Booking Calendar for Service Businesses v1.0.3
1.0.29 1.0.28 1.0.27 1.0.26 1.0.25 1.0.24 1.0.23 1.0.22 1.0.21 1.0.20 1.0.19 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.2 1.0.3 All 31 releases
booktics / trunk / core / appointment / schedule / time-slot.php

time-slot.php in Booktics – Appointment Booking Calendar for Service Businesses 1.0.3, at trunk/core/appointment/schedule/time-slot.php

69 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Booktics\Appointment\Schedule;
3
4 use JsonSerializable;
5
6 /**
7 * Timeslot class
8 */
9 class Time_Slot implements JsonSerializable {
10 /**
11 * Store start time
12 *
13 * @var string
14 */
15 public $start;
16
17 /**
18 * Store end time
19 *
20 * @var string
21 */
22 public $end;
23
24 /**
25 * Store time slot status
26 *
27 * @var bool
28 */
29 public $is_available;
30
31 /**
32 * Constructor timeslot class
33 *
34 * @param string $start Start time for a time slot
35 * @param string $end End time for a time slot
36 * @param bool $is_available Status for time slot
37 * @param true
38 *
39 * @return void
40 */
41 public function __construct( string $start, string $end, bool $is_available = true ) {
42 $this->start = $start;
43 $this->end = $end;
44 $this->is_available = $is_available;
45 }
46
47 /**
48 * Get time slot data as an array
49 *
50 * @return array Timeslot data
51 */
52 public function to_array(): array {
53 return [
54 'start' => $this->start,
55 'end' => $this->end,
56 'is_available' => $this->is_available,
57 ];
58 }
59
60 /**
61 * Specify data which should be serialized to JSON.
62 *
63 * @return array
64 */
65 public function jsonSerialize(): array {
66 return $this->to_array();
67 }
68 }
69