1 | <?php |
||
30 | class Booking |
||
31 | { |
||
32 | |||
33 | /** |
||
34 | * Default date format |
||
35 | * |
||
36 | * @var string DEFAULT_DATE_FORMAT |
||
37 | */ |
||
38 | const DEFAULT_DATE_FORMAT = 'Y-m-d H:i:s'; |
||
39 | |||
40 | /** |
||
41 | * Id of a potential ticket the booking is for |
||
42 | * |
||
43 | * @var string|null $ticketId |
||
44 | */ |
||
45 | protected $ticketId; |
||
46 | |||
47 | /** |
||
48 | * Comment regarding the current booking |
||
49 | * |
||
50 | * @var string $comment |
||
51 | */ |
||
52 | protected $comment; |
||
53 | |||
54 | /** |
||
55 | * Time this booking was made |
||
56 | * |
||
57 | * @var string $time |
||
58 | */ |
||
59 | protected $time; |
||
60 | |||
61 | /** |
||
62 | * A list of special ticket IDs which identify a meta ticket |
||
63 | * |
||
64 | * @var string[] $metaTicketIds |
||
65 | */ |
||
66 | protected $metaTicketIds = array(); |
||
67 | |||
68 | /** |
||
69 | * Getter for the default date format |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | public function getDefaultDateFormat() |
||
77 | |||
78 | /** |
||
79 | * Getter for the booking time |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | public function getTime() |
||
87 | |||
88 | /** |
||
89 | * Getter for the booked ticket id |
||
90 | * |
||
91 | * @return string |
||
92 | */ |
||
93 | public function getTicketId() |
||
97 | |||
98 | /** |
||
99 | * Getter for the booking comment |
||
100 | * |
||
101 | * @return string |
||
102 | */ |
||
103 | public function getComment() |
||
107 | |||
108 | /** |
||
109 | * Whether or not this booking is a meta booking used |
||
110 | * to either create workflows or groupings of bookings and time durations |
||
111 | * |
||
112 | * @return boolean |
||
113 | */ |
||
114 | public function isMetaBooking() |
||
118 | |||
119 | /** |
||
120 | * Getter for the meta ticket IDs |
||
121 | * |
||
122 | * @return string[] |
||
123 | */ |
||
124 | public function getMetaTicketIds() |
||
128 | |||
129 | /** |
||
130 | * Default constructor |
||
131 | * |
||
132 | * @param string $comment Comment for the booking |
||
133 | * @param string $ticketId [optional] Optional ticket ID. Defaults to an empty string |
||
134 | * @param null|string|integer $time [optional] Time of this booking. Defaults to NULL |
||
135 | */ |
||
136 | public function __construct($comment, $ticketId = '', $time = null) |
||
151 | |||
152 | /** |
||
153 | * Whether or not this booking can be the start of a task |
||
154 | * |
||
155 | * @return boolean |
||
156 | */ |
||
157 | public function canStartTask() |
||
161 | |||
162 | /** |
||
163 | * Whether or not this booking can be the end of a task |
||
164 | * |
||
165 | * @return boolean |
||
166 | */ |
||
167 | public function canEndTask() |
||
171 | } |
||
172 |