Test Failed
Push — master ( 156c37...627d8f )
by Zbigniew
03:20
created

TaskResourceModel::setMetadata()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
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\Task;
13
14
use Zibios\WrikePhpJmsserializer\Model\Common\CustomFieldModel;
15
use Zibios\WrikePhpJmsserializer\Model\Common\MetadataModel;
16
use Zibios\WrikePhpJmsserializer\Model\Common\TaskDatesModel;
17
use Zibios\WrikePhpJmsserializer\Model\ResourceModelInterface;
18
19
/**
20
 * Task Resource Model.
21
 */
22
class TaskResourceModel implements ResourceModelInterface
23
{
24
    /**
25
     * Task ID.
26
     *
27
     * Comment: Task ID
28
     *
29
     * @SA\Type("string")
30
     * @SA\SerializedName("id")
31
     *
32
     * @var string|null
33
     */
34
    protected $id;
35
36
    /**
37
     * Account ID.
38
     *
39
     * Comment: Account ID
40
     *
41
     * @SA\Type("string")
42
     * @SA\SerializedName("accountId")
43
     *
44
     * @var string|null
45
     */
46
    protected $accountId;
47
48
    /**
49
     * Title, cannot be empty.
50
     *
51
     * @SA\Type("string")
52
     * @SA\SerializedName("title")
53
     *
54
     * @var string|null
55
     */
56
    protected $title;
57
58
    /**
59
     * Description.
60
     *
61
     * Comment: Optional
62
     *
63
     * @SA\Type("string")
64
     * @SA\SerializedName("description")
65
     *
66
     * @var string|null
67
     */
68
    protected $description;
69
70
    /**
71
     * Brief description.
72
     *
73
     * Comment: Optional
74
     *
75
     * @SA\Type("string")
76
     * @SA\SerializedName("briefDescription")
77
     *
78
     * @var string|null
79
     */
80
    protected $briefDescription;
81
82
    /**
83
     * List of task parent folder IDs.
84
     *
85
     * Comment: Folder ID list
86
     * Comment: Optional
87
     *
88
     * @SA\Type("array<string>")
89
     * @SA\SerializedName("parentIds")
90
     *
91
     * @var array|string[]|null
92
     */
93
    protected $parentIds;
94
95
    /**
96
     * List of task super parent folder IDs.
97
     *
98
     * Comment: Folder ID list
99
     * Comment: Optional
100
     *
101
     * @SA\Type("array<string>")
102
     * @SA\SerializedName("superParentIds")
103
     *
104
     * @var array|string[]|null
105
     */
106
    protected $superParentIds;
107
108
    /**
109
     * List of user IDs, who share the task.
110
     *
111
     * Comment: Contact ID list
112
     * Comment: Optional
113
     *
114
     * @SA\Type("array<string>")
115
     * @SA\SerializedName("sharedIds")
116
     *
117
     * @var array|string[]|null
118
     */
119
    protected $sharedIds;
120
121
    /**
122
     * List of responsible user IDs.
123
     *
124
     * Comment: Contact ID list
125
     * Comment: Optional
126
     *
127
     * @SA\Type("array<string>")
128
     * @SA\SerializedName("responsibleIds")
129
     *
130
     * @var array|string[]|null
131
     */
132
    protected $responsibleIds;
133
134
    /**
135
     * Status of task.
136
     *
137
     * Task Status, Enum: Active, Completed, Deferred, Cancelled
138
     *
139
     * @see \Zibios\WrikePhpLibrary\Enum\TaskStatusEnum
140
     *
141
     * @SA\Type("string")
142
     * @SA\SerializedName("status")
143
     *
144
     * @var string|null
145
     */
146
    protected $status;
147
148
    /**
149
     * Importance of task.
150
     *
151
     * Task Importance, Enum: High, Normal, Low
152
     *
153
     * @see \Zibios\WrikePhpLibrary\Enum\TaskImportanceEnum
154
     *
155
     * @SA\Type("string")
156
     * @SA\SerializedName("importance")
157
     *
158
     * @var string|null
159
     */
160
    protected $importance;
161
162
    /**
163
     * Created date.
164
     *
165
     * Format: yyyy-MM-dd'T'HH:mm:ss'Z'
166
     *
167
     * @SA\Type("DateTime<'Y-m-d\TH:i:s\Z'>")
168
     * @SA\SerializedName("createdDate")
169
     *
170
     * @var \DateTime|null
171
     */
172
    protected $createdDate;
173
174
    /**
175
     * Updated date.
176
     *
177
     * Format: yyyy-MM-dd'T'HH:mm:ss'Z'
178
     *
179
     * @SA\Type("DateTime<'Y-m-d\TH:i:s\Z'>")
180
     * @SA\SerializedName("updatedDate")
181
     *
182
     * @var \DateTime|null
183
     */
184
    protected $updatedDate;
185
186
    /**
187
     * Completed date, field is present for tasks with 'Completed' status.
188
     *
189
     * Format: yyyy-MM-dd'T'HH:mm:ss'Z'
190
     *
191
     * @SA\Type("DateTime<'Y-m-d\TH:i:s\Z'>")
192
     * @SA\SerializedName("completedDate")
193
     *
194
     * @var \DateTime|null
195
     */
196
    protected $completedDate;
197
198
    /**
199
     * Task dates.
200
     *
201
     * @SA\Type("Zibios\WrikePhpJmsserializer\Model\Common\TaskDatesModel")
202
     * @SA\SerializedName("dates")
203
     *
204
     * @var TaskDatesModel|null
205
     */
206
    protected $dates;
207
208
    /**
209
     * Task scope.
210
     *
211
     * Tree Scope, Enum: WsRoot, RbRoot, WsFolder, RbFolder, WsTask, RbTask
212
     *
213
     * @see \Zibios\WrikePhpLibrary\Enum\TreeScopeEnum
214
     *
215
     * @SA\Type("string")
216
     * @SA\SerializedName("scope")
217
     *
218
     * @var string|null
219
     */
220
    protected $scope;
221
222
    /**
223
     * List of author IDs (currently contains 1 element).
224
     *
225
     * Comment: Contact ID list
226
     * Comment: Optional
227
     *
228
     * @SA\Type("array<string>")
229
     * @SA\SerializedName("authorIds")
230
     *
231
     * @var array|string[]|null
232
     */
233
    protected $authorIds;
234
235
    /**
236
     * Custom status ID.
237
     *
238
     * Comment: Custom status ID
239
     *
240
     * @SA\Type("string")
241
     * @SA\SerializedName("customStatusId")
242
     *
243
     * @var string|null
244
     */
245
    protected $customStatusId;
246
247
    /**
248
     * Has attachments.
249
     *
250
     * @SA\Type("boolean")
251
     * @SA\SerializedName("hasAttachments")
252
     *
253
     * @var bool|null
254
     */
255
    protected $hasAttachments;
256
257
    /**
258
     * Total count of task attachments.
259
     *
260
     * Comment: Optional
261
     *
262
     * @SA\Type("integer")
263
     * @SA\SerializedName("attachmentCount")
264
     *
265
     * @var string|null
266
     */
267
    protected $attachmentCount;
268
269
    /**
270
     * Link to open task in web workspace, if user has appropriate access.
271
     *
272
     * @SA\Type("string")
273
     * @SA\SerializedName("permalink")
274
     *
275
     * @var string|null
276
     */
277
    protected $permalink;
278
279
    /**
280
     * Ordering key that defines task order in tasklist.
281
     *
282
     * @SA\Type("string")
283
     * @SA\SerializedName("priority")
284
     *
285
     * @var string|null
286
     */
287
    protected $priority;
288
289
    /**
290
     * Is a task followed by me.
291
     *
292
     * Comment: Optional
293
     *
294
     * @SA\Type("boolean")
295
     * @SA\SerializedName("followedByMe")
296
     *
297
     * @var bool|null
298
     */
299
    protected $followedByMe;
300
301
    /**
302
     * List of user IDs, who follows task.
303
     *
304
     * Comment: Contact ID list
305
     * Comment: Optional
306
     *
307
     * @SA\Type("array<string>")
308
     * @SA\SerializedName("followerIds")
309
     *
310
     * @var array|string[]|null
311
     */
312
    protected $followerIds;
313
314
    /**
315
     * Is a task recurrent.
316
     *
317
     * Comment: Optional
318
     *
319
     * @SA\Type("boolean")
320
     * @SA\SerializedName("recurrent")
321
     *
322
     * @var bool|null
323
     */
324
    protected $recurrent;
325
326
    /**
327
     * List of super task IDs.
328
     *
329
     * Comment: Task ID list
330
     * Comment: Optional
331
     *
332
     * @SA\Type("array<string>")
333
     * @SA\SerializedName("superTaskIds")
334
     *
335
     * @var array|string[]|null
336
     */
337
    protected $superTaskIds;
338
339
    /**
340
     * List of subtask IDs.
341
     *
342
     * Comment: Task ID list
343
     * Comment: Optional
344
     *
345
     * @SA\Type("array<string>")
346
     * @SA\SerializedName("subTaskIds")
347
     *
348
     * @var array|string[]|null
349
     */
350
    protected $subTaskIds;
351
352
    /**
353
     * List of dependency IDs.
354
     *
355
     * Comment: Dependency ID list
356
     * Comment: Optional
357
     *
358
     * @SA\Type("array<string>")
359
     * @SA\SerializedName("dependencyIds")
360
     *
361
     * @var array|string[]|null
362
     */
363
    protected $dependencyIds;
364
365
    /**
366
     * List of task metadata entries.
367
     *
368
     * Metadata entry key-value pair
369
     * Metadata entries are isolated on per-client (application) basis
370
     * Comment: Optional
371
     *
372
     * @SA\Type("array<Zibios\WrikePhpJmsserializer\Model\Common\MetadataModel>")
373
     * @SA\SerializedName("metadata")
374
     *
375
     * @var array|MetadataModel[]|null
376
     */
377
    protected $metadata;
378
379
    /**
380
     * Custom fields.
381
     *
382
     * Comment: Optional
383
     *
384
     * @SA\Type("array<Zibios\WrikePhpJmsserializer\Model\Common\CustomFieldModel>")
385
     * @SA\SerializedName("customFields")
386
     *
387
     * @var array|CustomFieldModel[]|null
388
     */
389
    protected $customFields;
390
391
    /**
392
     * @return null|string
393
     */
394 1
    public function getId()
395
    {
396 1
        return $this->id;
397
    }
398
399
    /**
400
     * @param null|string $id
401
     *
402
     * @return $this
403
     */
404 1
    public function setId($id)
405
    {
406 1
        $this->id = $id;
407
408 1
        return $this;
409
    }
410
411
    /**
412
     * @return null|string
413
     */
414 1
    public function getAccountId()
415
    {
416 1
        return $this->accountId;
417
    }
418
419
    /**
420
     * @param null|string $accountId
421
     *
422
     * @return $this
423
     */
424 1
    public function setAccountId($accountId)
425
    {
426 1
        $this->accountId = $accountId;
427
428 1
        return $this;
429
    }
430
431
    /**
432
     * @return null|string
433
     */
434 1
    public function getTitle()
435
    {
436 1
        return $this->title;
437
    }
438
439
    /**
440
     * @param null|string $title
441
     *
442
     * @return $this
443
     */
444 1
    public function setTitle($title)
445
    {
446 1
        $this->title = $title;
447
448 1
        return $this;
449
    }
450
451
    /**
452
     * @return null|string
453
     */
454 1
    public function getDescription()
455
    {
456 1
        return $this->description;
457
    }
458
459
    /**
460
     * @param null|string $description
461
     *
462
     * @return $this
463
     */
464 1
    public function setDescription($description)
465
    {
466 1
        $this->description = $description;
467
468 1
        return $this;
469
    }
470
471
    /**
472
     * @return null|string
473
     */
474 1
    public function getBriefDescription()
475
    {
476 1
        return $this->briefDescription;
477
    }
478
479
    /**
480
     * @param null|string $briefDescription
481
     *
482
     * @return $this
483
     */
484 1
    public function setBriefDescription($briefDescription)
485
    {
486 1
        $this->briefDescription = $briefDescription;
487
488 1
        return $this;
489
    }
490
491
    /**
492
     * @return array|null|\string[]
493
     */
494 1
    public function getParentIds()
495
    {
496 1
        return $this->parentIds;
497
    }
498
499
    /**
500
     * @param array|null|\string[] $parentIds
501
     *
502
     * @return $this
503
     */
504 1
    public function setParentIds($parentIds)
505
    {
506 1
        $this->parentIds = $parentIds;
507
508 1
        return $this;
509
    }
510
511
    /**
512
     * @return array|null|\string[]
513
     */
514 1
    public function getSuperParentIds()
515
    {
516 1
        return $this->superParentIds;
517
    }
518
519
    /**
520
     * @param array|null|\string[] $superParentIds
521
     *
522
     * @return $this
523
     */
524 1
    public function setSuperParentIds($superParentIds)
525
    {
526 1
        $this->superParentIds = $superParentIds;
527
528 1
        return $this;
529
    }
530
531
    /**
532
     * @return array|null|\string[]
533
     */
534 1
    public function getSharedIds()
535
    {
536 1
        return $this->sharedIds;
537
    }
538
539
    /**
540
     * @param array|null|\string[] $sharedIds
541
     *
542
     * @return $this
543
     */
544 1
    public function setSharedIds($sharedIds)
545
    {
546 1
        $this->sharedIds = $sharedIds;
547
548 1
        return $this;
549
    }
550
551
    /**
552
     * @return array|null|\string[]
553
     */
554 1
    public function getResponsibleIds()
555
    {
556 1
        return $this->responsibleIds;
557
    }
558
559
    /**
560
     * @param array|null|\string[] $responsibleIds
561
     *
562
     * @return $this
563
     */
564 1
    public function setResponsibleIds($responsibleIds)
565
    {
566 1
        $this->responsibleIds = $responsibleIds;
567
568 1
        return $this;
569
    }
570
571
    /**
572
     * @return null|string
573
     */
574 1
    public function getStatus()
575
    {
576 1
        return $this->status;
577
    }
578
579
    /**
580
     * @param null|string $status
581
     *
582
     * @return $this
583
     */
584 1
    public function setStatus($status)
585
    {
586 1
        $this->status = $status;
587
588 1
        return $this;
589
    }
590
591
    /**
592
     * @return null|string
593
     */
594 1
    public function getImportance()
595
    {
596 1
        return $this->importance;
597
    }
598
599
    /**
600
     * @param null|string $importance
601
     *
602
     * @return $this
603
     */
604 1
    public function setImportance($importance)
605
    {
606 1
        $this->importance = $importance;
607
608 1
        return $this;
609
    }
610
611
    /**
612
     * @return \DateTime|null
613
     */
614 1
    public function getCreatedDate()
615
    {
616 1
        return $this->createdDate;
617
    }
618
619
    /**
620
     * @param \DateTime|null $createdDate
621
     *
622
     * @return $this
623
     */
624 1
    public function setCreatedDate($createdDate)
625
    {
626 1
        $this->createdDate = $createdDate;
627
628 1
        return $this;
629
    }
630
631
    /**
632
     * @return \DateTime|null
633
     */
634 1
    public function getUpdatedDate()
635
    {
636 1
        return $this->updatedDate;
637
    }
638
639
    /**
640
     * @param \DateTime|null $updatedDate
641
     *
642
     * @return $this
643
     */
644 1
    public function setUpdatedDate($updatedDate)
645
    {
646 1
        $this->updatedDate = $updatedDate;
647
648 1
        return $this;
649
    }
650
651
    /**
652
     * @return \DateTime|null
653
     */
654 1
    public function getCompletedDate()
655
    {
656 1
        return $this->completedDate;
657
    }
658
659
    /**
660
     * @param \DateTime|null $completedDate
661
     *
662
     * @return $this
663
     */
664 1
    public function setCompletedDate($completedDate)
665
    {
666 1
        $this->completedDate = $completedDate;
667
668 1
        return $this;
669
    }
670
671
    /**
672
     * @return null|TaskDatesModel
673
     */
674 1
    public function getDates()
675
    {
676 1
        return $this->dates;
677
    }
678
679
    /**
680
     * @param null|TaskDatesModel $dates
681
     *
682
     * @return $this
683
     */
684 1
    public function setDates($dates)
685
    {
686 1
        $this->dates = $dates;
687
688 1
        return $this;
689
    }
690
691
    /**
692
     * @return null|string
693
     */
694 1
    public function getScope()
695
    {
696 1
        return $this->scope;
697
    }
698
699
    /**
700
     * @param null|string $scope
701
     *
702
     * @return $this
703
     */
704 1
    public function setScope($scope)
705
    {
706 1
        $this->scope = $scope;
707
708 1
        return $this;
709
    }
710
711
    /**
712
     * @return array|null|\string[]
713
     */
714 1
    public function getAuthorIds()
715
    {
716 1
        return $this->authorIds;
717
    }
718
719
    /**
720
     * @param array|null|\string[] $authorIds
721
     *
722
     * @return $this
723
     */
724 1
    public function setAuthorIds($authorIds)
725
    {
726 1
        $this->authorIds = $authorIds;
727
728 1
        return $this;
729
    }
730
731
    /**
732
     * @return null|string
733
     */
734 1
    public function getCustomStatusId()
735
    {
736 1
        return $this->customStatusId;
737
    }
738
739
    /**
740
     * @param null|string $customStatusId
741
     *
742
     * @return $this
743
     */
744 1
    public function setCustomStatusId($customStatusId)
745
    {
746 1
        $this->customStatusId = $customStatusId;
747
748 1
        return $this;
749
    }
750
751
    /**
752
     * @return bool|null
753
     */
754 1
    public function getHasAttachments()
755
    {
756 1
        return $this->hasAttachments;
757
    }
758
759
    /**
760
     * @param bool|null $hasAttachments
761
     *
762
     * @return $this
763
     */
764 1
    public function setHasAttachments($hasAttachments)
765
    {
766 1
        $this->hasAttachments = $hasAttachments;
767
768 1
        return $this;
769
    }
770
771
    /**
772
     * @return null|string
773
     */
774 1
    public function getAttachmentCount()
775
    {
776 1
        return $this->attachmentCount;
777
    }
778
779
    /**
780
     * @param null|string $attachmentCount
781
     *
782
     * @return $this
783
     */
784 1
    public function setAttachmentCount($attachmentCount)
785
    {
786 1
        $this->attachmentCount = $attachmentCount;
787
788 1
        return $this;
789
    }
790
791
    /**
792
     * @return null|string
793
     */
794 1
    public function getPermalink()
795
    {
796 1
        return $this->permalink;
797
    }
798
799
    /**
800
     * @param null|string $permalink
801
     *
802
     * @return $this
803
     */
804 1
    public function setPermalink($permalink)
805
    {
806 1
        $this->permalink = $permalink;
807
808 1
        return $this;
809
    }
810
811
    /**
812
     * @return null|string
813
     */
814 1
    public function getPriority()
815
    {
816 1
        return $this->priority;
817
    }
818
819
    /**
820
     * @param null|string $priority
821
     *
822
     * @return $this
823
     */
824 1
    public function setPriority($priority)
825
    {
826 1
        $this->priority = $priority;
827
828 1
        return $this;
829
    }
830
831
    /**
832
     * @return bool|null
833
     */
834 1
    public function getFollowedByMe()
835
    {
836 1
        return $this->followedByMe;
837
    }
838
839
    /**
840
     * @param bool|null $followedByMe
841
     *
842
     * @return $this
843
     */
844 1
    public function setFollowedByMe($followedByMe)
845
    {
846 1
        $this->followedByMe = $followedByMe;
847
848 1
        return $this;
849
    }
850
851
    /**
852
     * @return array|null|\string[]
853
     */
854 1
    public function getFollowerIds()
855
    {
856 1
        return $this->followerIds;
857
    }
858
859
    /**
860
     * @param array|null|\string[] $followerIds
861
     *
862
     * @return $this
863
     */
864 1
    public function setFollowerIds($followerIds)
865
    {
866 1
        $this->followerIds = $followerIds;
867
868 1
        return $this;
869
    }
870
871
    /**
872
     * @return bool|null
873
     */
874 1
    public function getRecurrent()
875
    {
876 1
        return $this->recurrent;
877
    }
878
879
    /**
880
     * @param bool|null $recurrent
881
     *
882
     * @return $this
883
     */
884 1
    public function setRecurrent($recurrent)
885
    {
886 1
        $this->recurrent = $recurrent;
887
888 1
        return $this;
889
    }
890
891
    /**
892
     * @return array|null|\string[]
893
     */
894 1
    public function getSuperTaskIds()
895
    {
896 1
        return $this->superTaskIds;
897
    }
898
899
    /**
900
     * @param array|null|\string[] $superTaskIds
901
     *
902
     * @return $this
903
     */
904 1
    public function setSuperTaskIds($superTaskIds)
905
    {
906 1
        $this->superTaskIds = $superTaskIds;
907
908 1
        return $this;
909
    }
910
911
    /**
912
     * @return array|null|\string[]
913
     */
914 1
    public function getSubTaskIds()
915
    {
916 1
        return $this->subTaskIds;
917
    }
918
919
    /**
920
     * @param array|null|\string[] $subTaskIds
921
     *
922
     * @return $this
923
     */
924 1
    public function setSubTaskIds($subTaskIds)
925
    {
926 1
        $this->subTaskIds = $subTaskIds;
927
928 1
        return $this;
929
    }
930
931
    /**
932
     * @return array|null|\string[]
933
     */
934 1
    public function getDependencyIds()
935
    {
936 1
        return $this->dependencyIds;
937
    }
938
939
    /**
940
     * @param array|null|\string[] $dependencyIds
941
     *
942
     * @return $this
943
     */
944 1
    public function setDependencyIds($dependencyIds)
945
    {
946 1
        $this->dependencyIds = $dependencyIds;
947
948 1
        return $this;
949
    }
950
951
    /**
952
     * @return array|null|MetadataModel[]
953
     */
954 1
    public function getMetadata()
955
    {
956 1
        return $this->metadata;
957
    }
958
959
    /**
960
     * @param array|null|MetadataModel[] $metadata
961
     *
962
     * @return $this
963
     */
964 1
    public function setMetadata($metadata)
965
    {
966 1
        $this->metadata = $metadata;
967
968 1
        return $this;
969
    }
970
971
    /**
972
     * @return array|null|CustomFieldModel[]
973
     */
974 1
    public function getCustomFields()
975
    {
976 1
        return $this->customFields;
977
    }
978
979
    /**
980
     * @param array|null|CustomFieldModel[] $customFields
981
     *
982
     * @return $this
983
     */
984 1
    public function setCustomFields($customFields)
985
    {
986 1
        $this->customFields = $customFields;
987
988 1
        return $this;
989
    }
990
}
991