1 | <?php |
||
30 | class Task |
||
31 | { |
||
32 | |||
33 | /** |
||
34 | * First booking of this task |
||
35 | * |
||
36 | * @var \Wicked\Timely\Entities\Booking $startBooking |
||
37 | */ |
||
38 | protected $startBooking; |
||
39 | |||
40 | /** |
||
41 | * Last booking of this task |
||
42 | * |
||
43 | * @var \Wicked\Timely\Entities\Booking $endBooking |
||
44 | */ |
||
45 | protected $endBooking; |
||
46 | |||
47 | /** |
||
48 | * Bookings within this task |
||
49 | * |
||
50 | * @var \Wicked\Timely\Entities\Booking[] $intermediateBookings |
||
51 | */ |
||
52 | protected $intermediateBookings; |
||
53 | |||
54 | /** |
||
55 | * Intermediate tasks, done within this task instance |
||
56 | * |
||
57 | * @var \Wicked\Timely\Entities\Task[] $intermediateTasks |
||
58 | */ |
||
59 | protected $intermediateTasks; |
||
60 | |||
61 | /** |
||
62 | * The task's duration |
||
63 | * |
||
64 | * @var integer $duration |
||
65 | */ |
||
66 | protected $duration; |
||
67 | |||
68 | /** |
||
69 | * Whether or not the task is being clipped due to filtering |
||
70 | * |
||
71 | * @var boolean $isClipped |
||
72 | */ |
||
73 | protected $isClipped = false; |
||
74 | |||
75 | /** |
||
76 | * Getter for the first booking of the task instance |
||
77 | * |
||
78 | * @return \Wicked\Timely\Entities\Booking |
||
79 | */ |
||
80 | public function getStartBooking() |
||
84 | |||
85 | /** |
||
86 | * Getter for the first booking of the task instance |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | public function getStartTime() |
||
98 | |||
99 | /** |
||
100 | * Getter for the first booking of the task instance |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | public function getComment() |
||
108 | |||
109 | /** |
||
110 | * Getter for the first booking of the task instance |
||
111 | * |
||
112 | * @return string |
||
113 | */ |
||
114 | public function isPushed() |
||
118 | |||
119 | /** |
||
120 | * Getter for the last booking of the task instance |
||
121 | * |
||
122 | * @return \Wicked\Timely\Entities\Booking |
||
123 | */ |
||
124 | public function getEndBooking() |
||
128 | |||
129 | /** |
||
130 | * Getter for the first booking of the task instance |
||
131 | * |
||
132 | * @return string |
||
133 | */ |
||
134 | public function getEndTime() |
||
138 | |||
139 | /** |
||
140 | * Getter for the intermediate bookings |
||
141 | * |
||
142 | * @return \Wicked\Timely\Entities\Booking[] |
||
143 | */ |
||
144 | public function getIntermediateBookings() |
||
148 | |||
149 | /** |
||
150 | * Getter for the task's ticket id |
||
151 | * |
||
152 | * @return string |
||
153 | */ |
||
154 | public function getTicketId() |
||
158 | |||
159 | /** |
||
160 | * Getter for the task duration |
||
161 | * |
||
162 | * @return integer |
||
163 | */ |
||
164 | public function getDuration() |
||
168 | |||
169 | /** |
||
170 | * Getter for the task duration |
||
171 | * |
||
172 | * @return integer |
||
173 | */ |
||
174 | protected function isClipped() |
||
178 | |||
179 | /** |
||
180 | * Default constructor |
||
181 | * |
||
182 | * @param \Wicked\Timely\Entities\Booking $startBooking The first booking of the task |
||
183 | * @param \Wicked\Timely\Entities\Booking $endBooking The last booking of the task |
||
184 | * @param \Wicked\Timely\Entities\Booking[] $intermediateBookings Bookings within this task |
||
185 | */ |
||
186 | public function __construct($startBooking, $endBooking, $intermediateBookings) |
||
202 | |||
203 | /** |
||
204 | * Calculates the duration of a task by given bookings |
||
205 | * |
||
206 | * @param \Wicked\Timely\Entities\Booking $startBooking The first booking of the task |
||
207 | * @param \Wicked\Timely\Entities\Booking $endBooking The last booking of the task |
||
208 | * @param \Wicked\Timely\Entities\Booking[] $intermediateBookings Bookings within this task |
||
209 | * |
||
210 | * @return integer |
||
211 | */ |
||
212 | protected function calculateDuration($startBooking, $endBooking, array $intermediateBookings) |
||
237 | } |
||
238 |