1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the zibios/wrike-php-jmsserializer package. |
5
|
|
|
* |
6
|
|
|
* (c) Zbigniew Ślązak |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Zibios\WrikePhpJmsserializer\Model\Common; |
13
|
|
|
|
14
|
|
|
use JMS\Serializer\Annotation as SA; |
15
|
|
|
use Zibios\WrikePhpJmsserializer\Model\ResourceModelInterface; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Task Dates Model. |
19
|
|
|
*/ |
20
|
|
|
class TaskDatesModel implements ResourceModelInterface |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* Type. |
24
|
|
|
* |
25
|
|
|
* Task Dates, Enum: Backlog, Milestone, Planned |
26
|
|
|
* |
27
|
|
|
* @see \Zibios\WrikePhpLibrary\Enum\TaskDatesTypeEnum |
28
|
|
|
* |
29
|
|
|
* @SA\Type("string") |
30
|
|
|
* @SA\SerializedName("type") |
31
|
|
|
* |
32
|
|
|
* @var string|null |
33
|
|
|
*/ |
34
|
|
|
protected $type; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* Duration in minutes. Duration is present in Planned tasks and is optional for Backlog tasks. |
38
|
|
|
* |
39
|
|
|
* @SA\Type("integer") |
40
|
|
|
* @SA\SerializedName("duration") |
41
|
|
|
* |
42
|
|
|
* @var int|null |
43
|
|
|
*/ |
44
|
|
|
protected $duration; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* Start date is present only in Planned tasks. |
48
|
|
|
* |
49
|
|
|
* Format: yyyy-MM-dd'T'HH:mm:ss ('T'HH:mm:ss is optional) |
50
|
|
|
* |
51
|
|
|
* @SA\Type("DateTime<'Y-m-d\TH:i:s\Z'>") |
52
|
|
|
* @SA\SerializedName("start") |
53
|
|
|
* |
54
|
|
|
* @var \DateTime|null |
55
|
|
|
*/ |
56
|
|
|
protected $start; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Due date is present only in Planned and Milestone tasks. |
60
|
|
|
* |
61
|
|
|
* Format: yyyy-MM-dd'T'HH:mm:ss ('T'HH:mm:ss is optional) |
62
|
|
|
* |
63
|
|
|
* @SA\Type("DateTime<'Y-m-d\TH:i:s\Z'>") |
64
|
|
|
* @SA\SerializedName("due") |
65
|
|
|
* |
66
|
|
|
* @var \DateTime|null |
67
|
|
|
*/ |
68
|
|
|
protected $due; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Weekends are included in task scheduling. |
72
|
|
|
* |
73
|
|
|
* Comment: Optional |
74
|
|
|
* |
75
|
|
|
* @SA\Type("boolean") |
76
|
|
|
* @SA\SerializedName("workOnWeekends") |
77
|
|
|
* |
78
|
|
|
* @var bool|null |
79
|
|
|
*/ |
80
|
|
|
protected $workOnWeekends; |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @return null|string |
84
|
|
|
*/ |
85
|
1 |
|
public function getType() |
86
|
|
|
{ |
87
|
1 |
|
return $this->type; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @param null|string $type |
92
|
|
|
* |
93
|
|
|
* @return $this |
94
|
|
|
*/ |
95
|
1 |
|
public function setType($type) |
96
|
|
|
{ |
97
|
1 |
|
$this->type = $type; |
98
|
|
|
|
99
|
1 |
|
return $this; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @return int|null |
104
|
|
|
*/ |
105
|
1 |
|
public function getDuration() |
106
|
|
|
{ |
107
|
1 |
|
return $this->duration; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* @param int|null $duration |
112
|
|
|
* |
113
|
|
|
* @return $this |
114
|
|
|
*/ |
115
|
1 |
|
public function setDuration($duration) |
116
|
|
|
{ |
117
|
1 |
|
$this->duration = $duration; |
118
|
|
|
|
119
|
1 |
|
return $this; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @return \DateTime|null |
124
|
|
|
*/ |
125
|
1 |
|
public function getStart() |
126
|
|
|
{ |
127
|
1 |
|
return $this->start; |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* @param \DateTime|null $start |
132
|
|
|
* |
133
|
|
|
* @return $this |
134
|
|
|
*/ |
135
|
1 |
|
public function setStart($start) |
136
|
|
|
{ |
137
|
1 |
|
$this->start = $start; |
138
|
|
|
|
139
|
1 |
|
return $this; |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* @return \DateTime|null |
144
|
|
|
*/ |
145
|
1 |
|
public function getDue() |
146
|
|
|
{ |
147
|
1 |
|
return $this->due; |
148
|
|
|
} |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* @param \DateTime|null $due |
152
|
|
|
* |
153
|
|
|
* @return $this |
154
|
|
|
*/ |
155
|
1 |
|
public function setDue($due) |
156
|
|
|
{ |
157
|
1 |
|
$this->due = $due; |
158
|
|
|
|
159
|
1 |
|
return $this; |
160
|
|
|
} |
161
|
|
|
|
162
|
|
|
/** |
163
|
|
|
* @return bool|null |
164
|
|
|
*/ |
165
|
1 |
|
public function getWorkOnWeekends() |
166
|
|
|
{ |
167
|
1 |
|
return $this->workOnWeekends; |
168
|
|
|
} |
169
|
|
|
|
170
|
|
|
/** |
171
|
|
|
* @param bool|null $workOnWeekends |
172
|
|
|
* |
173
|
|
|
* @return $this |
174
|
|
|
*/ |
175
|
1 |
|
public function setWorkOnWeekends($workOnWeekends) |
176
|
|
|
{ |
177
|
1 |
|
$this->workOnWeekends = $workOnWeekends; |
178
|
|
|
|
179
|
1 |
|
return $this; |
180
|
|
|
} |
181
|
|
|
} |
182
|
|
|
|