|
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\Account; |
|
13
|
|
|
|
|
14
|
|
|
use Zibios\WrikePhpJmsserializer\Model\Common\MetadataModel; |
|
15
|
|
|
use Zibios\WrikePhpJmsserializer\Model\Common\SubscriptionModel; |
|
16
|
|
|
use Zibios\WrikePhpJmsserializer\Model\CustomField\CustomFieldResourceModel; |
|
17
|
|
|
use Zibios\WrikePhpJmsserializer\Model\ResourceModelInterface; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* Account Resource Model. |
|
21
|
|
|
*/ |
|
22
|
|
|
class AccountResourceModel implements ResourceModelInterface |
|
23
|
|
|
{ |
|
24
|
|
|
/** |
|
25
|
|
|
* Account ID. |
|
26
|
|
|
* |
|
27
|
|
|
* Comment: Account ID |
|
28
|
|
|
* |
|
29
|
|
|
* @SA\Type("string") |
|
30
|
|
|
* @SA\SerializedName("id") |
|
31
|
|
|
* |
|
32
|
|
|
* @var string|null |
|
33
|
|
|
*/ |
|
34
|
|
|
protected $id; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* Name of account. |
|
38
|
|
|
* |
|
39
|
|
|
* @SA\Type("string") |
|
40
|
|
|
* @SA\SerializedName("name") |
|
41
|
|
|
* |
|
42
|
|
|
* @var string|null |
|
43
|
|
|
*/ |
|
44
|
|
|
protected $name; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* Date format: dd/MM/yyyy or MM/dd/yyyy. |
|
48
|
|
|
* |
|
49
|
|
|
* @SA\Type("string") |
|
50
|
|
|
* @SA\SerializedName("dateFormat") |
|
51
|
|
|
* |
|
52
|
|
|
* @var string|null |
|
53
|
|
|
*/ |
|
54
|
|
|
protected $dateFormat; |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* First day of week. |
|
58
|
|
|
* |
|
59
|
|
|
* Week Day, Enum: Sat, Sun, Mon |
|
60
|
|
|
* |
|
61
|
|
|
* @see \Zibios\WrikePhpLibrary\Enum\WeekDayEnum |
|
62
|
|
|
* |
|
63
|
|
|
* @SA\Type("string") |
|
64
|
|
|
* @SA\SerializedName("firstDayOfWeek") |
|
65
|
|
|
* |
|
66
|
|
|
* @var string|null |
|
67
|
|
|
*/ |
|
68
|
|
|
protected $firstDayOfWeek; |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* List of weekdays, not empty. |
|
72
|
|
|
* |
|
73
|
|
|
* These days are used in task duration computation. |
|
74
|
|
|
* Week Day, Enum: Sun, Mon, Tue, Wed, Thu, Fri, Sat |
|
75
|
|
|
* |
|
76
|
|
|
* @see \Zibios\WrikePhpLibrary\Enum\WeekDayEnum |
|
77
|
|
|
* |
|
78
|
|
|
* @SA\Type("string") |
|
79
|
|
|
* @SA\SerializedName("workDays") |
|
80
|
|
|
* |
|
81
|
|
|
* @var string|null |
|
82
|
|
|
*/ |
|
83
|
|
|
protected $workDays; |
|
84
|
|
|
|
|
85
|
|
|
/** |
|
86
|
|
|
* Virtual folder, denotes the root folder of the account. |
|
87
|
|
|
* |
|
88
|
|
|
* Different users can have different elements in the root, according to their sharing scope. |
|
89
|
|
|
* Can be used in queries to get all folders/tasks in the account, |
|
90
|
|
|
* or to create folders/tasks in the user's account root |
|
91
|
|
|
* |
|
92
|
|
|
* Comment: Folder ID |
|
93
|
|
|
* |
|
94
|
|
|
* @SA\Type("string") |
|
95
|
|
|
* @SA\SerializedName("rootFolderId") |
|
96
|
|
|
* |
|
97
|
|
|
* @var string|null |
|
98
|
|
|
*/ |
|
99
|
|
|
protected $rootFolderId; |
|
100
|
|
|
|
|
101
|
|
|
/** |
|
102
|
|
|
* Virtual folder, denotes the root for deleted folders and tasks. |
|
103
|
|
|
* |
|
104
|
|
|
* Can be used in queries to get all folders/tasks in the Recycle Bin. Cannot be used in modification queries. |
|
105
|
|
|
* |
|
106
|
|
|
* Comment: Folder ID |
|
107
|
|
|
* |
|
108
|
|
|
* @SA\Type("string") |
|
109
|
|
|
* @SA\SerializedName("recycleBinId") |
|
110
|
|
|
* |
|
111
|
|
|
* @var string|null |
|
112
|
|
|
*/ |
|
113
|
|
|
protected $recycleBinId; |
|
114
|
|
|
|
|
115
|
|
|
/** |
|
116
|
|
|
* Registration date. |
|
117
|
|
|
* |
|
118
|
|
|
* Format: yyyy-MM-dd'T'HH:mm:ss'Z' |
|
119
|
|
|
* |
|
120
|
|
|
* @SA\Type("DateTime<'Y-m-d\TH:i:s\Z'>") |
|
121
|
|
|
* @SA\SerializedName("createdDate") |
|
122
|
|
|
* |
|
123
|
|
|
* @var \DateTime|null |
|
124
|
|
|
*/ |
|
125
|
|
|
protected $createdDate; |
|
126
|
|
|
|
|
127
|
|
|
/** |
|
128
|
|
|
* Account subscription. |
|
129
|
|
|
* |
|
130
|
|
|
* Comment: Optional |
|
131
|
|
|
* |
|
132
|
|
|
* @SA\Type("Zibios\WrikePhpJmsserializer\Model\Common\SubscriptionModel") |
|
133
|
|
|
* @SA\SerializedName("subscription") |
|
134
|
|
|
* |
|
135
|
|
|
* @var SubscriptionModel|null |
|
136
|
|
|
*/ |
|
137
|
|
|
protected $subscription; |
|
138
|
|
|
|
|
139
|
|
|
/** |
|
140
|
|
|
* List of account metadata entries. |
|
141
|
|
|
* Entries could be read by all users of account and modified by admins only |
|
142
|
|
|
* Metadata entry key-value pair |
|
143
|
|
|
* Metadata entries are isolated on per-client (application) basis. |
|
144
|
|
|
* |
|
145
|
|
|
* Comment: Optional |
|
146
|
|
|
* |
|
147
|
|
|
* @SA\Type("array<Zibios\WrikePhpJmsserializer\Model\Common\MetadataModel>") |
|
148
|
|
|
* @SA\SerializedName("metadata") |
|
149
|
|
|
* |
|
150
|
|
|
* @var array|MetadataModel[]|null |
|
151
|
|
|
*/ |
|
152
|
|
|
protected $metadata; |
|
153
|
|
|
|
|
154
|
|
|
/** |
|
155
|
|
|
* List of custom fields accessible for requesting user in the account. |
|
156
|
|
|
* Entries could be read by all users of account and modified by admins only. |
|
157
|
|
|
* |
|
158
|
|
|
* Comment: Optional |
|
159
|
|
|
* |
|
160
|
|
|
* @SA\Type("array<Zibios\WrikePhpJmsserializer\Model\CustomField\CustomFieldResourceModel>") |
|
161
|
|
|
* @SA\SerializedName("customFields") |
|
162
|
|
|
* |
|
163
|
|
|
* @var array|CustomFieldResourceModel[]|null |
|
164
|
|
|
*/ |
|
165
|
|
|
protected $customFields; |
|
166
|
|
|
|
|
167
|
|
|
/** |
|
168
|
|
|
* Date when the user has joined the account. |
|
169
|
|
|
* |
|
170
|
|
|
* Format: yyyy-MM-dd'T'HH:mm:ss'Z' |
|
171
|
|
|
* |
|
172
|
|
|
* @SA\Type("DateTime<'Y-m-d\TH:i:s\Z'>") |
|
173
|
|
|
* @SA\SerializedName("joinedDate") |
|
174
|
|
|
* |
|
175
|
|
|
* @var \DateTime|null |
|
176
|
|
|
*/ |
|
177
|
|
|
protected $joinedDate; |
|
178
|
|
|
|
|
179
|
|
|
/** |
|
180
|
|
|
* @return null|string |
|
181
|
|
|
*/ |
|
182
|
1 |
|
public function getId() |
|
183
|
|
|
{ |
|
184
|
1 |
|
return $this->id; |
|
185
|
|
|
} |
|
186
|
|
|
|
|
187
|
|
|
/** |
|
188
|
|
|
* @param null|string $id |
|
189
|
|
|
* |
|
190
|
|
|
* @return $this |
|
191
|
|
|
*/ |
|
192
|
1 |
|
public function setId($id) |
|
193
|
|
|
{ |
|
194
|
1 |
|
$this->id = $id; |
|
195
|
|
|
|
|
196
|
1 |
|
return $this; |
|
197
|
|
|
} |
|
198
|
|
|
|
|
199
|
|
|
/** |
|
200
|
|
|
* @return null|string |
|
201
|
|
|
*/ |
|
202
|
1 |
|
public function getName() |
|
203
|
|
|
{ |
|
204
|
1 |
|
return $this->name; |
|
205
|
|
|
} |
|
206
|
|
|
|
|
207
|
|
|
/** |
|
208
|
|
|
* @param null|string $name |
|
209
|
|
|
* |
|
210
|
|
|
* @return $this |
|
211
|
|
|
*/ |
|
212
|
1 |
|
public function setName($name) |
|
213
|
|
|
{ |
|
214
|
1 |
|
$this->name = $name; |
|
215
|
|
|
|
|
216
|
1 |
|
return $this; |
|
217
|
|
|
} |
|
218
|
|
|
|
|
219
|
|
|
/** |
|
220
|
|
|
* @return null|string |
|
221
|
|
|
*/ |
|
222
|
1 |
|
public function getDateFormat() |
|
223
|
|
|
{ |
|
224
|
1 |
|
return $this->dateFormat; |
|
225
|
|
|
} |
|
226
|
|
|
|
|
227
|
|
|
/** |
|
228
|
|
|
* @param null|string $dateFormat |
|
229
|
|
|
* |
|
230
|
|
|
* @return $this |
|
231
|
|
|
*/ |
|
232
|
1 |
|
public function setDateFormat($dateFormat) |
|
233
|
|
|
{ |
|
234
|
1 |
|
$this->dateFormat = $dateFormat; |
|
235
|
|
|
|
|
236
|
1 |
|
return $this; |
|
237
|
|
|
} |
|
238
|
|
|
|
|
239
|
|
|
/** |
|
240
|
|
|
* @return null|string |
|
241
|
|
|
*/ |
|
242
|
1 |
|
public function getFirstDayOfWeek() |
|
243
|
|
|
{ |
|
244
|
1 |
|
return $this->firstDayOfWeek; |
|
245
|
|
|
} |
|
246
|
|
|
|
|
247
|
|
|
/** |
|
248
|
|
|
* @param null|string $firstDayOfWeek |
|
249
|
|
|
* |
|
250
|
|
|
* @return $this |
|
251
|
|
|
*/ |
|
252
|
1 |
|
public function setFirstDayOfWeek($firstDayOfWeek) |
|
253
|
|
|
{ |
|
254
|
1 |
|
$this->firstDayOfWeek = $firstDayOfWeek; |
|
255
|
|
|
|
|
256
|
1 |
|
return $this; |
|
257
|
|
|
} |
|
258
|
|
|
|
|
259
|
|
|
/** |
|
260
|
|
|
* @return null|string |
|
261
|
|
|
*/ |
|
262
|
1 |
|
public function getWorkDays() |
|
263
|
|
|
{ |
|
264
|
1 |
|
return $this->workDays; |
|
265
|
|
|
} |
|
266
|
|
|
|
|
267
|
|
|
/** |
|
268
|
|
|
* @param null|string $workDays |
|
269
|
|
|
* |
|
270
|
|
|
* @return $this |
|
271
|
|
|
*/ |
|
272
|
1 |
|
public function setWorkDays($workDays) |
|
273
|
|
|
{ |
|
274
|
1 |
|
$this->workDays = $workDays; |
|
275
|
|
|
|
|
276
|
1 |
|
return $this; |
|
277
|
|
|
} |
|
278
|
|
|
|
|
279
|
|
|
/** |
|
280
|
|
|
* @return null|string |
|
281
|
|
|
*/ |
|
282
|
1 |
|
public function getRootFolderId() |
|
283
|
|
|
{ |
|
284
|
1 |
|
return $this->rootFolderId; |
|
285
|
|
|
} |
|
286
|
|
|
|
|
287
|
|
|
/** |
|
288
|
|
|
* @param null|string $rootFolderId |
|
289
|
|
|
* |
|
290
|
|
|
* @return $this |
|
291
|
|
|
*/ |
|
292
|
1 |
|
public function setRootFolderId($rootFolderId) |
|
293
|
|
|
{ |
|
294
|
1 |
|
$this->rootFolderId = $rootFolderId; |
|
295
|
|
|
|
|
296
|
1 |
|
return $this; |
|
297
|
|
|
} |
|
298
|
|
|
|
|
299
|
|
|
/** |
|
300
|
|
|
* @return null|string |
|
301
|
|
|
*/ |
|
302
|
1 |
|
public function getRecycleBinId() |
|
303
|
|
|
{ |
|
304
|
1 |
|
return $this->recycleBinId; |
|
305
|
|
|
} |
|
306
|
|
|
|
|
307
|
|
|
/** |
|
308
|
|
|
* @param null|string $recycleBinId |
|
309
|
|
|
* |
|
310
|
|
|
* @return $this |
|
311
|
|
|
*/ |
|
312
|
1 |
|
public function setRecycleBinId($recycleBinId) |
|
313
|
|
|
{ |
|
314
|
1 |
|
$this->recycleBinId = $recycleBinId; |
|
315
|
|
|
|
|
316
|
1 |
|
return $this; |
|
317
|
|
|
} |
|
318
|
|
|
|
|
319
|
|
|
/** |
|
320
|
|
|
* @return \DateTime|null |
|
321
|
|
|
*/ |
|
322
|
1 |
|
public function getCreatedDate() |
|
323
|
|
|
{ |
|
324
|
1 |
|
return $this->createdDate; |
|
325
|
|
|
} |
|
326
|
|
|
|
|
327
|
|
|
/** |
|
328
|
|
|
* @param \DateTime|null $createdDate |
|
329
|
|
|
* |
|
330
|
|
|
* @return $this |
|
331
|
|
|
*/ |
|
332
|
1 |
|
public function setCreatedDate($createdDate) |
|
333
|
|
|
{ |
|
334
|
1 |
|
$this->createdDate = $createdDate; |
|
335
|
|
|
|
|
336
|
1 |
|
return $this; |
|
337
|
|
|
} |
|
338
|
|
|
|
|
339
|
|
|
/** |
|
340
|
|
|
* @return null|SubscriptionModel |
|
341
|
|
|
*/ |
|
342
|
1 |
|
public function getSubscription() |
|
343
|
|
|
{ |
|
344
|
1 |
|
return $this->subscription; |
|
345
|
|
|
} |
|
346
|
|
|
|
|
347
|
|
|
/** |
|
348
|
|
|
* @param null|SubscriptionModel $subscription |
|
349
|
|
|
* |
|
350
|
|
|
* @return $this |
|
351
|
|
|
*/ |
|
352
|
1 |
|
public function setSubscription($subscription) |
|
353
|
|
|
{ |
|
354
|
1 |
|
$this->subscription = $subscription; |
|
355
|
|
|
|
|
356
|
1 |
|
return $this; |
|
357
|
|
|
} |
|
358
|
|
|
|
|
359
|
|
|
/** |
|
360
|
|
|
* @return array|null|MetadataModel[] |
|
361
|
|
|
*/ |
|
362
|
1 |
|
public function getMetadata() |
|
363
|
|
|
{ |
|
364
|
1 |
|
return $this->metadata; |
|
365
|
|
|
} |
|
366
|
|
|
|
|
367
|
|
|
/** |
|
368
|
|
|
* @param array|null|MetadataModel[] $metadata |
|
369
|
|
|
* |
|
370
|
|
|
* @return $this |
|
371
|
|
|
*/ |
|
372
|
1 |
|
public function setMetadata($metadata) |
|
373
|
|
|
{ |
|
374
|
1 |
|
$this->metadata = $metadata; |
|
375
|
|
|
|
|
376
|
1 |
|
return $this; |
|
377
|
|
|
} |
|
378
|
|
|
|
|
379
|
|
|
/** |
|
380
|
|
|
* @return array|null|CustomFieldResourceModel[] |
|
381
|
|
|
*/ |
|
382
|
1 |
|
public function getCustomFields() |
|
383
|
|
|
{ |
|
384
|
1 |
|
return $this->customFields; |
|
385
|
|
|
} |
|
386
|
|
|
|
|
387
|
|
|
/** |
|
388
|
|
|
* @param array|null|CustomFieldResourceModel[] $customFields |
|
389
|
|
|
* |
|
390
|
|
|
* @return $this |
|
391
|
|
|
*/ |
|
392
|
1 |
|
public function setCustomFields($customFields) |
|
393
|
|
|
{ |
|
394
|
1 |
|
$this->customFields = $customFields; |
|
395
|
|
|
|
|
396
|
1 |
|
return $this; |
|
397
|
|
|
} |
|
398
|
|
|
|
|
399
|
|
|
/** |
|
400
|
|
|
* @return \DateTime|null |
|
401
|
|
|
*/ |
|
402
|
1 |
|
public function getJoinedDate() |
|
403
|
|
|
{ |
|
404
|
1 |
|
return $this->joinedDate; |
|
405
|
|
|
} |
|
406
|
|
|
|
|
407
|
|
|
/** |
|
408
|
|
|
* @param \DateTime|null $joinedDate |
|
409
|
|
|
* |
|
410
|
|
|
* @return $this |
|
411
|
|
|
*/ |
|
412
|
1 |
|
public function setJoinedDate($joinedDate) |
|
413
|
|
|
{ |
|
414
|
1 |
|
$this->joinedDate = $joinedDate; |
|
415
|
|
|
|
|
416
|
1 |
|
return $this; |
|
417
|
|
|
} |
|
418
|
|
|
} |
|
419
|
|
|
|