1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the timechimp bundle package. |
7
|
|
|
* (c) Connect Holland. |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
namespace ConnectHolland\TimechimpBundle\Api\Model; |
11
|
|
|
|
12
|
|
|
class Time |
13
|
|
|
{ |
14
|
|
|
/** |
15
|
|
|
* @var int |
16
|
|
|
*/ |
17
|
|
|
protected $id; |
18
|
|
|
/** |
19
|
|
|
* CustomerId or ProjectId is required. |
20
|
|
|
* |
21
|
|
|
* @var int |
22
|
|
|
*/ |
23
|
|
|
protected $customerId; |
24
|
|
|
/** |
25
|
|
|
* @var string |
26
|
|
|
*/ |
27
|
|
|
protected $customerName; |
28
|
|
|
/** |
29
|
|
|
* CustomerId or ProjectId is required. When ProjectId is filled, CustomerId can be empty. |
30
|
|
|
* |
31
|
|
|
* @var int |
32
|
|
|
*/ |
33
|
|
|
protected $projectId; |
34
|
|
|
/** |
35
|
|
|
* @var string |
36
|
|
|
*/ |
37
|
|
|
protected $projectName; |
38
|
|
|
/** |
39
|
|
|
* Use projectTaskId if working with projects. |
40
|
|
|
* |
41
|
|
|
* @var int |
42
|
|
|
*/ |
43
|
|
|
protected $projectTaskId; |
44
|
|
|
/** |
45
|
|
|
* Use task if working not working with projects (only customers). |
46
|
|
|
* |
47
|
|
|
* @var int |
48
|
|
|
*/ |
49
|
|
|
protected $taskId; |
50
|
|
|
/** |
51
|
|
|
* @var string |
52
|
|
|
*/ |
53
|
|
|
protected $taskName; |
54
|
|
|
/** |
55
|
|
|
* If UserId is empty, current user will be linked. |
56
|
|
|
* |
57
|
|
|
* @var int |
58
|
|
|
*/ |
59
|
|
|
protected $userId; |
60
|
|
|
/** |
61
|
|
|
* @var string |
62
|
|
|
*/ |
63
|
|
|
protected $userDisplayName; |
64
|
|
|
/** |
65
|
|
|
* @var string[] |
66
|
|
|
*/ |
67
|
|
|
protected $userTags; |
68
|
|
|
/** |
69
|
|
|
* @var \DateTime |
70
|
|
|
*/ |
71
|
|
|
protected $date; |
72
|
|
|
/** |
73
|
|
|
* @var float |
74
|
|
|
*/ |
75
|
|
|
protected $hours; |
76
|
|
|
/** |
77
|
|
|
* @var string |
78
|
|
|
*/ |
79
|
|
|
protected $notes; |
80
|
|
|
/** |
81
|
|
|
* 0 = Open, 1 = PendingApproval, 2 = Approved, 3 = Invoiced, 4 = WrittenOff, -1 = Rejected. |
82
|
|
|
* |
83
|
|
|
* @var int |
84
|
|
|
*/ |
85
|
|
|
protected $status; |
86
|
|
|
/** |
87
|
|
|
* DEPRECATED property for the start+end time of a time. Use {start} and {end} properties from now on. |
88
|
|
|
* |
89
|
|
|
* @var string |
90
|
|
|
*/ |
91
|
|
|
protected $startEnd; |
92
|
|
|
/** |
93
|
|
|
* The start date + time (UTC) on which the time starts. |
94
|
|
|
* |
95
|
|
|
* @var string |
96
|
|
|
*/ |
97
|
|
|
protected $start; |
98
|
|
|
/** |
99
|
|
|
* The end date + time (UTC) on which the time ends. Condition: {end} >= {start}. |
100
|
|
|
* |
101
|
|
|
* @var string |
102
|
|
|
*/ |
103
|
|
|
protected $end; |
104
|
|
|
/** |
105
|
|
|
* @var float |
106
|
|
|
*/ |
107
|
|
|
protected $pause; |
108
|
|
|
/** |
109
|
|
|
* @var string |
110
|
|
|
*/ |
111
|
|
|
protected $externalName; |
112
|
|
|
/** |
113
|
|
|
* @var string |
114
|
|
|
*/ |
115
|
|
|
protected $externalUrl; |
116
|
|
|
/** |
117
|
|
|
* 0 = Open, 1 = PendingApproval, 2 = Approved, 3 = Invoiced, 4 = WrittenOff, -1 = Rejected. |
118
|
|
|
* |
119
|
|
|
* @var int |
120
|
|
|
*/ |
121
|
|
|
protected $statusIntern; |
122
|
|
|
/** |
123
|
|
|
* 0 = Open, 1 = PendingApproval, 2 = Approved, 3 = Invoiced, 4 = WrittenOff, -1 = Rejected. |
124
|
|
|
* |
125
|
|
|
* @var int |
126
|
|
|
*/ |
127
|
|
|
protected $statusExtern; |
128
|
|
|
/** |
129
|
|
|
* @var Tag[] |
130
|
|
|
*/ |
131
|
|
|
protected $tags; |
132
|
|
|
|
133
|
|
|
public function getId(): int |
134
|
|
|
{ |
135
|
|
|
return $this->id; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
public function setId(int $id): self |
139
|
|
|
{ |
140
|
|
|
$this->id = $id; |
141
|
|
|
|
142
|
|
|
return $this; |
143
|
|
|
} |
144
|
|
|
|
145
|
|
|
/** |
146
|
|
|
* CustomerId or ProjectId is required. |
147
|
|
|
*/ |
148
|
|
|
public function getCustomerId(): int |
149
|
|
|
{ |
150
|
|
|
return $this->customerId; |
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
/** |
154
|
|
|
* CustomerId or ProjectId is required. |
155
|
|
|
*/ |
156
|
|
|
public function setCustomerId(int $customerId): self |
157
|
|
|
{ |
158
|
|
|
$this->customerId = $customerId; |
159
|
|
|
|
160
|
|
|
return $this; |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
public function getCustomerName(): string |
164
|
|
|
{ |
165
|
|
|
return $this->customerName; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
public function setCustomerName(string $customerName): self |
169
|
|
|
{ |
170
|
|
|
$this->customerName = $customerName; |
171
|
|
|
|
172
|
|
|
return $this; |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* CustomerId or ProjectId is required. When ProjectId is filled, CustomerId can be empty. |
177
|
|
|
*/ |
178
|
|
|
public function getProjectId(): int |
179
|
|
|
{ |
180
|
|
|
return $this->projectId; |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* CustomerId or ProjectId is required. When ProjectId is filled, CustomerId can be empty. |
185
|
|
|
*/ |
186
|
|
|
public function setProjectId(int $projectId): self |
187
|
|
|
{ |
188
|
|
|
$this->projectId = $projectId; |
189
|
|
|
|
190
|
|
|
return $this; |
191
|
|
|
} |
192
|
|
|
|
193
|
|
|
public function getProjectName(): string |
194
|
|
|
{ |
195
|
|
|
return $this->projectName; |
196
|
|
|
} |
197
|
|
|
|
198
|
|
|
public function setProjectName(string $projectName): self |
199
|
|
|
{ |
200
|
|
|
$this->projectName = $projectName; |
201
|
|
|
|
202
|
|
|
return $this; |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
/** |
206
|
|
|
* Use projectTaskId if working with projects. |
207
|
|
|
*/ |
208
|
|
|
public function getProjectTaskId(): int |
209
|
|
|
{ |
210
|
|
|
return $this->projectTaskId; |
211
|
|
|
} |
212
|
|
|
|
213
|
|
|
/** |
214
|
|
|
* Use projectTaskId if working with projects. |
215
|
|
|
*/ |
216
|
|
|
public function setProjectTaskId(int $projectTaskId): self |
217
|
|
|
{ |
218
|
|
|
$this->projectTaskId = $projectTaskId; |
219
|
|
|
|
220
|
|
|
return $this; |
221
|
|
|
} |
222
|
|
|
|
223
|
|
|
/** |
224
|
|
|
* Use task if working not working with projects (only customers). |
225
|
|
|
*/ |
226
|
|
|
public function getTaskId(): int |
227
|
|
|
{ |
228
|
|
|
return $this->taskId; |
229
|
|
|
} |
230
|
|
|
|
231
|
|
|
/** |
232
|
|
|
* Use task if working not working with projects (only customers). |
233
|
|
|
*/ |
234
|
|
|
public function setTaskId(int $taskId): self |
235
|
|
|
{ |
236
|
|
|
$this->taskId = $taskId; |
237
|
|
|
|
238
|
|
|
return $this; |
239
|
|
|
} |
240
|
|
|
|
241
|
|
|
public function getTaskName(): string |
242
|
|
|
{ |
243
|
|
|
return $this->taskName; |
244
|
|
|
} |
245
|
|
|
|
246
|
|
|
public function setTaskName(string $taskName): self |
247
|
|
|
{ |
248
|
|
|
$this->taskName = $taskName; |
249
|
|
|
|
250
|
|
|
return $this; |
251
|
|
|
} |
252
|
|
|
|
253
|
|
|
/** |
254
|
|
|
* If UserId is empty, current user will be linked. |
255
|
|
|
*/ |
256
|
|
|
public function getUserId(): int |
257
|
|
|
{ |
258
|
|
|
return $this->userId; |
259
|
|
|
} |
260
|
|
|
|
261
|
|
|
/** |
262
|
|
|
* If UserId is empty, current user will be linked. |
263
|
|
|
*/ |
264
|
|
|
public function setUserId(int $userId): self |
265
|
|
|
{ |
266
|
|
|
$this->userId = $userId; |
267
|
|
|
|
268
|
|
|
return $this; |
269
|
|
|
} |
270
|
|
|
|
271
|
|
|
public function getUserDisplayName(): string |
272
|
|
|
{ |
273
|
|
|
return $this->userDisplayName; |
274
|
|
|
} |
275
|
|
|
|
276
|
|
|
public function setUserDisplayName(string $userDisplayName): self |
277
|
|
|
{ |
278
|
|
|
$this->userDisplayName = $userDisplayName; |
279
|
|
|
|
280
|
|
|
return $this; |
281
|
|
|
} |
282
|
|
|
|
283
|
|
|
/** |
284
|
|
|
* @return string[] |
285
|
|
|
*/ |
286
|
|
|
public function getUserTags(): array |
287
|
|
|
{ |
288
|
|
|
return $this->userTags; |
289
|
|
|
} |
290
|
|
|
|
291
|
|
|
/** |
292
|
|
|
* @param string[] $userTags |
293
|
|
|
*/ |
294
|
|
|
public function setUserTags(array $userTags): self |
295
|
|
|
{ |
296
|
|
|
$this->userTags = $userTags; |
297
|
|
|
|
298
|
|
|
return $this; |
299
|
|
|
} |
300
|
|
|
|
301
|
|
|
public function getDate(): \DateTime |
302
|
|
|
{ |
303
|
|
|
return $this->date; |
304
|
|
|
} |
305
|
|
|
|
306
|
|
|
public function setDate(\DateTime $date): self |
307
|
|
|
{ |
308
|
|
|
$this->date = $date; |
309
|
|
|
|
310
|
|
|
return $this; |
311
|
|
|
} |
312
|
|
|
|
313
|
|
|
public function getHours(): float |
314
|
|
|
{ |
315
|
|
|
return $this->hours; |
316
|
|
|
} |
317
|
|
|
|
318
|
|
|
public function setHours(float $hours): self |
319
|
|
|
{ |
320
|
|
|
$this->hours = $hours; |
321
|
|
|
|
322
|
|
|
return $this; |
323
|
|
|
} |
324
|
|
|
|
325
|
|
|
public function getNotes(): string |
326
|
|
|
{ |
327
|
|
|
return $this->notes; |
328
|
|
|
} |
329
|
|
|
|
330
|
|
|
public function setNotes(string $notes): self |
331
|
|
|
{ |
332
|
|
|
$this->notes = $notes; |
333
|
|
|
|
334
|
|
|
return $this; |
335
|
|
|
} |
336
|
|
|
|
337
|
|
|
/** |
338
|
|
|
* 0 = Open, 1 = PendingApproval, 2 = Approved, 3 = Invoiced, 4 = WrittenOff, -1 = Rejected. |
339
|
|
|
*/ |
340
|
|
|
public function getStatus(): int |
341
|
|
|
{ |
342
|
|
|
return $this->status; |
343
|
|
|
} |
344
|
|
|
|
345
|
|
|
/** |
346
|
|
|
* 0 = Open, 1 = PendingApproval, 2 = Approved, 3 = Invoiced, 4 = WrittenOff, -1 = Rejected. |
347
|
|
|
*/ |
348
|
|
|
public function setStatus(int $status): self |
349
|
|
|
{ |
350
|
|
|
$this->status = $status; |
351
|
|
|
|
352
|
|
|
return $this; |
353
|
|
|
} |
354
|
|
|
|
355
|
|
|
/** |
356
|
|
|
* DEPRECATED property for the start+end time of a time. Use {start} and {end} properties from now on. |
357
|
|
|
*/ |
358
|
|
|
public function getStartEnd(): string |
359
|
|
|
{ |
360
|
|
|
return $this->startEnd; |
361
|
|
|
} |
362
|
|
|
|
363
|
|
|
/** |
364
|
|
|
* DEPRECATED property for the start+end time of a time. Use {start} and {end} properties from now on. |
365
|
|
|
*/ |
366
|
|
|
public function setStartEnd(string $startEnd): self |
367
|
|
|
{ |
368
|
|
|
$this->startEnd = $startEnd; |
369
|
|
|
|
370
|
|
|
return $this; |
371
|
|
|
} |
372
|
|
|
|
373
|
|
|
/** |
374
|
|
|
* The start date + time (UTC) on which the time starts. |
375
|
|
|
*/ |
376
|
|
|
public function getStart(): string |
377
|
|
|
{ |
378
|
|
|
return $this->start; |
379
|
|
|
} |
380
|
|
|
|
381
|
|
|
/** |
382
|
|
|
* The start date + time (UTC) on which the time starts. |
383
|
|
|
*/ |
384
|
|
|
public function setStart(string $start): self |
385
|
|
|
{ |
386
|
|
|
$this->start = $start; |
387
|
|
|
|
388
|
|
|
return $this; |
389
|
|
|
} |
390
|
|
|
|
391
|
|
|
/** |
392
|
|
|
* The end date + time (UTC) on which the time ends. Condition: {end} >= {start}. |
393
|
|
|
*/ |
394
|
|
|
public function getEnd(): string |
395
|
|
|
{ |
396
|
|
|
return $this->end; |
397
|
|
|
} |
398
|
|
|
|
399
|
|
|
/** |
400
|
|
|
* The end date + time (UTC) on which the time ends. Condition: {end} >= {start}. |
401
|
|
|
*/ |
402
|
|
|
public function setEnd(string $end): self |
403
|
|
|
{ |
404
|
|
|
$this->end = $end; |
405
|
|
|
|
406
|
|
|
return $this; |
407
|
|
|
} |
408
|
|
|
|
409
|
|
|
public function getPause(): float |
410
|
|
|
{ |
411
|
|
|
return $this->pause; |
412
|
|
|
} |
413
|
|
|
|
414
|
|
|
public function setPause(float $pause): self |
415
|
|
|
{ |
416
|
|
|
$this->pause = $pause; |
417
|
|
|
|
418
|
|
|
return $this; |
419
|
|
|
} |
420
|
|
|
|
421
|
|
|
public function getExternalName(): string |
422
|
|
|
{ |
423
|
|
|
return $this->externalName; |
424
|
|
|
} |
425
|
|
|
|
426
|
|
|
public function setExternalName(string $externalName): self |
427
|
|
|
{ |
428
|
|
|
$this->externalName = $externalName; |
429
|
|
|
|
430
|
|
|
return $this; |
431
|
|
|
} |
432
|
|
|
|
433
|
|
|
public function getExternalUrl(): string |
434
|
|
|
{ |
435
|
|
|
return $this->externalUrl; |
436
|
|
|
} |
437
|
|
|
|
438
|
|
|
public function setExternalUrl(string $externalUrl): self |
439
|
|
|
{ |
440
|
|
|
$this->externalUrl = $externalUrl; |
441
|
|
|
|
442
|
|
|
return $this; |
443
|
|
|
} |
444
|
|
|
|
445
|
|
|
/** |
446
|
|
|
* 0 = Open, 1 = PendingApproval, 2 = Approved, 3 = Invoiced, 4 = WrittenOff, -1 = Rejected. |
447
|
|
|
*/ |
448
|
|
|
public function getStatusIntern(): int |
449
|
|
|
{ |
450
|
|
|
return $this->statusIntern; |
451
|
|
|
} |
452
|
|
|
|
453
|
|
|
/** |
454
|
|
|
* 0 = Open, 1 = PendingApproval, 2 = Approved, 3 = Invoiced, 4 = WrittenOff, -1 = Rejected. |
455
|
|
|
*/ |
456
|
|
|
public function setStatusIntern(int $statusIntern): self |
457
|
|
|
{ |
458
|
|
|
$this->statusIntern = $statusIntern; |
459
|
|
|
|
460
|
|
|
return $this; |
461
|
|
|
} |
462
|
|
|
|
463
|
|
|
/** |
464
|
|
|
* 0 = Open, 1 = PendingApproval, 2 = Approved, 3 = Invoiced, 4 = WrittenOff, -1 = Rejected. |
465
|
|
|
*/ |
466
|
|
|
public function getStatusExtern(): int |
467
|
|
|
{ |
468
|
|
|
return $this->statusExtern; |
469
|
|
|
} |
470
|
|
|
|
471
|
|
|
/** |
472
|
|
|
* 0 = Open, 1 = PendingApproval, 2 = Approved, 3 = Invoiced, 4 = WrittenOff, -1 = Rejected. |
473
|
|
|
*/ |
474
|
|
|
public function setStatusExtern(int $statusExtern): self |
475
|
|
|
{ |
476
|
|
|
$this->statusExtern = $statusExtern; |
477
|
|
|
|
478
|
|
|
return $this; |
479
|
|
|
} |
480
|
|
|
|
481
|
|
|
/** |
482
|
|
|
* @return Tag[] |
483
|
|
|
*/ |
484
|
|
|
public function getTags(): array |
485
|
|
|
{ |
486
|
|
|
return $this->tags; |
487
|
|
|
} |
488
|
|
|
|
489
|
|
|
/** |
490
|
|
|
* @param Tag[] $tags |
491
|
|
|
*/ |
492
|
|
|
public function setTags(array $tags): self |
493
|
|
|
{ |
494
|
|
|
$this->tags = $tags; |
495
|
|
|
|
496
|
|
|
return $this; |
497
|
|
|
} |
498
|
|
|
} |
499
|
|
|
|