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 | /** @var bool */ |
||
70 | private $pushed; |
||
71 | |||
72 | /** |
||
73 | * @return bool |
||
74 | */ |
||
75 | public function isPushed() |
||
79 | |||
80 | /** |
||
81 | * @param bool $pushed |
||
82 | */ |
||
83 | public function setPushed($pushed) |
||
87 | |||
88 | /** |
||
89 | * Getter for the default date format |
||
90 | * |
||
91 | * @return string |
||
92 | */ |
||
93 | public function getDefaultDateFormat() |
||
97 | |||
98 | /** |
||
99 | * Getter for the booking time |
||
100 | * |
||
101 | * @return string |
||
102 | */ |
||
103 | public function getTime() |
||
107 | |||
108 | /** |
||
109 | * Getter for the booked ticket id |
||
110 | * |
||
111 | * @return string |
||
112 | */ |
||
113 | public function getTicketId() |
||
117 | |||
118 | /** |
||
119 | * Getter for the booking comment |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | public function getComment() |
||
127 | |||
128 | /** |
||
129 | * Whether or not this booking is a meta booking used |
||
130 | * to either create workflows or groupings of bookings and time durations |
||
131 | * |
||
132 | * @return boolean |
||
133 | */ |
||
134 | public function isMetaBooking() |
||
138 | |||
139 | /** |
||
140 | * Getter for the meta ticket IDs |
||
141 | * |
||
142 | * @return string[] |
||
143 | */ |
||
144 | public function getMetaTicketIds() |
||
148 | |||
149 | /** |
||
150 | * Default constructor |
||
151 | * |
||
152 | * @param string $comment Comment for the booking |
||
153 | * @param string $ticketId [optional] Optional ticket ID. Defaults to an empty string |
||
154 | * @param null|string|integer $time [optional] Time of this booking. Defaults to NULL |
||
155 | * @param bool $pushed [optional] If pushed to jira worklog |
||
156 | */ |
||
157 | public function __construct($comment, $ticketId = '', $time = null, $pushed=false) |
||
173 | |||
174 | /** |
||
175 | * Whether or not this booking can be the start of a task |
||
176 | * |
||
177 | * @return boolean |
||
178 | */ |
||
179 | public function canStartTask() |
||
183 | |||
184 | /** |
||
185 | * Whether or not this booking can be the end of a task |
||
186 | * |
||
187 | * @return boolean |
||
188 | */ |
||
189 | public function canEndTask() |
||
193 | } |
||
194 |