Passed
Pull Request — 1.11.x (#4515)
by Angel Fernando Quiroz
10:14
created

CWiki::getPageId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CourseBundle\Entity;
5
6
use Doctrine\Common\Collections\ArrayCollection;
7
use Doctrine\Common\Collections\Collection;
8
use Doctrine\ORM\Mapping as ORM;
9
10
/**
11
 * CWiki.
12
 *
13
 * @ORM\Table(
14
 *  name="c_wiki",
15
 *  indexes={
16
 *      @ORM\Index(name="course", columns={"c_id"}),
17
 *      @ORM\Index(name="reflink", columns={"reflink"}),
18
 *      @ORM\Index(name="group_id", columns={"group_id"}),
19
 *      @ORM\Index(name="page_id", columns={"page_id"}),
20
 *      @ORM\Index(name="session_id", columns={"session_id"})
21
 *  }
22
 * )
23
 * @ORM\Entity
24
 */
25
class CWiki
26
{
27
    /**
28
     * @var int
29
     *
30
     * @ORM\Column(name="iid", type="integer")
31
     * @ORM\Id
32
     * @ORM\GeneratedValue
33
     */
34
    protected $iid;
35
36
    /**
37
     * @var int
38
     *
39
     * @ORM\Column(name="c_id", type="integer")
40
     */
41
    protected $cId;
42
43
    /**
44
     * @var int
45
     *
46
     * @ORM\Column(name="id", type="integer", nullable=true)
47
     */
48
    protected $id;
49
50
    /**
51
     * @var int
52
     *
53
     * @ORM\Column(name="page_id", type="integer", nullable=true)
54
     */
55
    protected $pageId;
56
57
    /**
58
     * @var string
59
     *
60
     * @ORM\Column(name="reflink", type="string", length=255, nullable=false)
61
     */
62
    protected $reflink;
63
64
    /**
65
     * @var string
66
     *
67
     * @ORM\Column(name="title", type="string", length=255, nullable=false)
68
     */
69
    protected $title;
70
71
    /**
72
     * @var string
73
     *
74
     * @ORM\Column(name="content", type="text", nullable=false)
75
     */
76
    protected $content;
77
78
    /**
79
     * @var int
80
     *
81
     * @ORM\Column(name="user_id", type="integer", nullable=false)
82
     */
83
    protected $userId;
84
85
    /**
86
     * @var int
87
     *
88
     * @ORM\Column(name="group_id", type="integer", nullable=true)
89
     */
90
    protected $groupId;
91
92
    /**
93
     * @var \DateTime
94
     *
95
     * @ORM\Column(name="dtime", type="datetime", nullable=true)
96
     */
97
    protected $dtime;
98
99
    /**
100
     * @var int
101
     *
102
     * @ORM\Column(name="addlock", type="integer", nullable=false)
103
     */
104
    protected $addlock;
105
106
    /**
107
     * @var int
108
     *
109
     * @ORM\Column(name="editlock", type="integer", nullable=false)
110
     */
111
    protected $editlock;
112
113
    /**
114
     * @var int
115
     *
116
     * @ORM\Column(name="visibility", type="integer", nullable=false)
117
     */
118
    protected $visibility;
119
120
    /**
121
     * @var int
122
     *
123
     * @ORM\Column(name="addlock_disc", type="integer", nullable=false)
124
     */
125
    protected $addlockDisc;
126
127
    /**
128
     * @var int
129
     *
130
     * @ORM\Column(name="visibility_disc", type="integer", nullable=false)
131
     */
132
    protected $visibilityDisc;
133
134
    /**
135
     * @var int
136
     *
137
     * @ORM\Column(name="ratinglock_disc", type="integer", nullable=false)
138
     */
139
    protected $ratinglockDisc;
140
141
    /**
142
     * @var int
143
     *
144
     * @ORM\Column(name="assignment", type="integer", nullable=false)
145
     */
146
    protected $assignment;
147
148
    /**
149
     * @var string
150
     *
151
     * @ORM\Column(name="comment", type="text", nullable=false)
152
     */
153
    protected $comment;
154
155
    /**
156
     * @var string
157
     *
158
     * @ORM\Column(name="progress", type="text", nullable=false)
159
     */
160
    protected $progress;
161
162
    /**
163
     * @var int
164
     *
165
     * @ORM\Column(name="score", type="integer", nullable=true)
166
     */
167
    protected $score;
168
169
    /**
170
     * @var int
171
     *
172
     * @ORM\Column(name="version", type="integer", nullable=true)
173
     */
174
    protected $version;
175
176
    /**
177
     * @var int
178
     *
179
     * @ORM\Column(name="is_editing", type="integer", nullable=false)
180
     */
181
    protected $isEditing;
182
183
    /**
184
     * @var \DateTime
185
     *
186
     * @ORM\Column(name="time_edit", type="datetime", nullable=true)
187
     */
188
    protected $timeEdit;
189
190
    /**
191
     * @var int
192
     *
193
     * @ORM\Column(name="hits", type="integer", nullable=true)
194
     */
195
    protected $hits;
196
197
    /**
198
     * @var string
199
     *
200
     * @ORM\Column(name="linksto", type="text", nullable=false)
201
     */
202
    protected $linksto;
203
204
    /**
205
     * @var string
206
     *
207
     * @ORM\Column(name="tag", type="text", nullable=false)
208
     */
209
    protected $tag;
210
211
    /**
212
     * @var string
213
     *
214
     * @ORM\Column(name="user_ip", type="string", length=39, nullable=false)
215
     */
216
    protected $userIp;
217
218
    /**
219
     * @var int
220
     *
221
     * @ORM\Column(name="session_id", type="integer", nullable=true)
222
     */
223
    protected $sessionId;
224
    /**
225
     * @var Collection<int, CWikiCategory>
226
     * @ORM\ManyToMany(targetEntity="Chamilo\CourseBundle\Entity\CWikiCategory", inversedBy="wikiPages")
227
     * @ORM\JoinTable(
228
     *     name="c_wiki_rel_category",
229
     *     joinColumns={@ORM\JoinColumn(name="wiki_id", referencedColumnName="iid")},
230
     *     inverseJoinColumns={@ORM\JoinColumn(name="category_id", referencedColumnName="id")}
231
     * )
232
     */
233
    private $categories;
234
235
    public function __construct()
236
    {
237
        $this->categories = new ArrayCollection();
238
    }
239
240
    /**
241
     * Set pageId.
242
     *
243
     * @param int $pageId
244
     *
245
     * @return CWiki
246
     */
247
    public function setPageId($pageId)
248
    {
249
        $this->pageId = $pageId;
250
251
        return $this;
252
    }
253
254
    /**
255
     * Get pageId.
256
     *
257
     * @return int
258
     */
259
    public function getPageId()
260
    {
261
        return $this->pageId;
262
    }
263
264
    /**
265
     * Set reflink.
266
     *
267
     * @param string $reflink
268
     *
269
     * @return CWiki
270
     */
271
    public function setReflink($reflink)
272
    {
273
        $this->reflink = $reflink;
274
275
        return $this;
276
    }
277
278
    /**
279
     * Get reflink.
280
     *
281
     * @return string
282
     */
283
    public function getReflink()
284
    {
285
        return $this->reflink;
286
    }
287
288
    /**
289
     * Set title.
290
     *
291
     * @param string $title
292
     *
293
     * @return CWiki
294
     */
295
    public function setTitle($title)
296
    {
297
        $this->title = $title;
298
299
        return $this;
300
    }
301
302
    /**
303
     * Get title.
304
     *
305
     * @return string
306
     */
307
    public function getTitle()
308
    {
309
        return $this->title;
310
    }
311
312
    /**
313
     * Set content.
314
     *
315
     * @param string $content
316
     *
317
     * @return CWiki
318
     */
319
    public function setContent($content)
320
    {
321
        $this->content = $content;
322
323
        return $this;
324
    }
325
326
    /**
327
     * Get content.
328
     *
329
     * @return string
330
     */
331
    public function getContent()
332
    {
333
        return $this->content;
334
    }
335
336
    /**
337
     * Set userId.
338
     *
339
     * @param int $userId
340
     *
341
     * @return CWiki
342
     */
343
    public function setUserId($userId)
344
    {
345
        $this->userId = $userId;
346
347
        return $this;
348
    }
349
350
    /**
351
     * Get userId.
352
     *
353
     * @return int
354
     */
355
    public function getUserId()
356
    {
357
        return $this->userId;
358
    }
359
360
    /**
361
     * Set groupId.
362
     *
363
     * @param int $groupId
364
     *
365
     * @return CWiki
366
     */
367
    public function setGroupId($groupId)
368
    {
369
        $this->groupId = $groupId;
370
371
        return $this;
372
    }
373
374
    /**
375
     * Get groupId.
376
     *
377
     * @return int
378
     */
379
    public function getGroupId()
380
    {
381
        return $this->groupId;
382
    }
383
384
    /**
385
     * Set dtime.
386
     *
387
     * @param \DateTime $dtime
388
     *
389
     * @return CWiki
390
     */
391
    public function setDtime($dtime)
392
    {
393
        $this->dtime = $dtime;
394
395
        return $this;
396
    }
397
398
    /**
399
     * Get dtime.
400
     *
401
     * @return \DateTime
402
     */
403
    public function getDtime()
404
    {
405
        return $this->dtime;
406
    }
407
408
    /**
409
     * Set addlock.
410
     *
411
     * @param int $addlock
412
     *
413
     * @return CWiki
414
     */
415
    public function setAddlock($addlock)
416
    {
417
        $this->addlock = $addlock;
418
419
        return $this;
420
    }
421
422
    /**
423
     * Get addlock.
424
     *
425
     * @return int
426
     */
427
    public function getAddlock()
428
    {
429
        return $this->addlock;
430
    }
431
432
    /**
433
     * Set editlock.
434
     *
435
     * @param int $editlock
436
     *
437
     * @return CWiki
438
     */
439
    public function setEditlock($editlock)
440
    {
441
        $this->editlock = $editlock;
442
443
        return $this;
444
    }
445
446
    /**
447
     * Get editlock.
448
     *
449
     * @return int
450
     */
451
    public function getEditlock()
452
    {
453
        return $this->editlock;
454
    }
455
456
    /**
457
     * Set visibility.
458
     *
459
     * @param int $visibility
460
     *
461
     * @return CWiki
462
     */
463
    public function setVisibility($visibility)
464
    {
465
        $this->visibility = $visibility;
466
467
        return $this;
468
    }
469
470
    /**
471
     * Get visibility.
472
     *
473
     * @return int
474
     */
475
    public function getVisibility()
476
    {
477
        return $this->visibility;
478
    }
479
480
    /**
481
     * Set addlockDisc.
482
     *
483
     * @param int $addlockDisc
484
     *
485
     * @return CWiki
486
     */
487
    public function setAddlockDisc($addlockDisc)
488
    {
489
        $this->addlockDisc = $addlockDisc;
490
491
        return $this;
492
    }
493
494
    /**
495
     * Get addlockDisc.
496
     *
497
     * @return int
498
     */
499
    public function getAddlockDisc()
500
    {
501
        return $this->addlockDisc;
502
    }
503
504
    /**
505
     * Set visibilityDisc.
506
     *
507
     * @param int $visibilityDisc
508
     *
509
     * @return CWiki
510
     */
511
    public function setVisibilityDisc($visibilityDisc)
512
    {
513
        $this->visibilityDisc = $visibilityDisc;
514
515
        return $this;
516
    }
517
518
    /**
519
     * Get visibilityDisc.
520
     *
521
     * @return int
522
     */
523
    public function getVisibilityDisc()
524
    {
525
        return $this->visibilityDisc;
526
    }
527
528
    /**
529
     * Set ratinglockDisc.
530
     *
531
     * @param int $ratinglockDisc
532
     *
533
     * @return CWiki
534
     */
535
    public function setRatinglockDisc($ratinglockDisc)
536
    {
537
        $this->ratinglockDisc = $ratinglockDisc;
538
539
        return $this;
540
    }
541
542
    /**
543
     * Get ratinglockDisc.
544
     *
545
     * @return int
546
     */
547
    public function getRatinglockDisc()
548
    {
549
        return $this->ratinglockDisc;
550
    }
551
552
    /**
553
     * Set assignment.
554
     *
555
     * @param int $assignment
556
     *
557
     * @return CWiki
558
     */
559
    public function setAssignment($assignment)
560
    {
561
        $this->assignment = $assignment;
562
563
        return $this;
564
    }
565
566
    /**
567
     * Get assignment.
568
     *
569
     * @return int
570
     */
571
    public function getAssignment()
572
    {
573
        return $this->assignment;
574
    }
575
576
    /**
577
     * Set comment.
578
     *
579
     * @param string $comment
580
     *
581
     * @return CWiki
582
     */
583
    public function setComment($comment)
584
    {
585
        $this->comment = $comment;
586
587
        return $this;
588
    }
589
590
    /**
591
     * Get comment.
592
     *
593
     * @return string
594
     */
595
    public function getComment()
596
    {
597
        return $this->comment;
598
    }
599
600
    /**
601
     * Set progress.
602
     *
603
     * @param string $progress
604
     *
605
     * @return CWiki
606
     */
607
    public function setProgress($progress)
608
    {
609
        $this->progress = $progress;
610
611
        return $this;
612
    }
613
614
    /**
615
     * Get progress.
616
     *
617
     * @return string
618
     */
619
    public function getProgress()
620
    {
621
        return $this->progress;
622
    }
623
624
    /**
625
     * Set score.
626
     *
627
     * @param int $score
628
     *
629
     * @return CWiki
630
     */
631
    public function setScore($score)
632
    {
633
        $this->score = $score;
634
635
        return $this;
636
    }
637
638
    /**
639
     * Get score.
640
     *
641
     * @return int
642
     */
643
    public function getScore()
644
    {
645
        return $this->score;
646
    }
647
648
    /**
649
     * Set version.
650
     *
651
     * @param int $version
652
     *
653
     * @return CWiki
654
     */
655
    public function setVersion($version)
656
    {
657
        $this->version = $version;
658
659
        return $this;
660
    }
661
662
    /**
663
     * Get version.
664
     *
665
     * @return int
666
     */
667
    public function getVersion()
668
    {
669
        return $this->version;
670
    }
671
672
    /**
673
     * Set isEditing.
674
     *
675
     * @param int $isEditing
676
     *
677
     * @return CWiki
678
     */
679
    public function setIsEditing($isEditing)
680
    {
681
        $this->isEditing = $isEditing;
682
683
        return $this;
684
    }
685
686
    /**
687
     * Get isEditing.
688
     *
689
     * @return int
690
     */
691
    public function getIsEditing()
692
    {
693
        return $this->isEditing;
694
    }
695
696
    /**
697
     * Set timeEdit.
698
     *
699
     * @param \DateTime $timeEdit
700
     *
701
     * @return CWiki
702
     */
703
    public function setTimeEdit($timeEdit)
704
    {
705
        $this->timeEdit = $timeEdit;
706
707
        return $this;
708
    }
709
710
    /**
711
     * Get timeEdit.
712
     *
713
     * @return \DateTime
714
     */
715
    public function getTimeEdit()
716
    {
717
        return $this->timeEdit;
718
    }
719
720
    /**
721
     * Set hits.
722
     *
723
     * @param int $hits
724
     *
725
     * @return CWiki
726
     */
727
    public function setHits($hits)
728
    {
729
        $this->hits = $hits;
730
731
        return $this;
732
    }
733
734
    /**
735
     * Get hits.
736
     *
737
     * @return int
738
     */
739
    public function getHits()
740
    {
741
        return $this->hits;
742
    }
743
744
    /**
745
     * Set linksto.
746
     *
747
     * @param string $linksto
748
     *
749
     * @return CWiki
750
     */
751
    public function setLinksto($linksto)
752
    {
753
        $this->linksto = $linksto;
754
755
        return $this;
756
    }
757
758
    /**
759
     * Get linksto.
760
     *
761
     * @return string
762
     */
763
    public function getLinksto()
764
    {
765
        return $this->linksto;
766
    }
767
768
    /**
769
     * Set tag.
770
     *
771
     * @param string $tag
772
     *
773
     * @return CWiki
774
     */
775
    public function setTag($tag)
776
    {
777
        $this->tag = $tag;
778
779
        return $this;
780
    }
781
782
    /**
783
     * Get tag.
784
     *
785
     * @return string
786
     */
787
    public function getTag()
788
    {
789
        return $this->tag;
790
    }
791
792
    /**
793
     * Set userIp.
794
     *
795
     * @param string $userIp
796
     *
797
     * @return CWiki
798
     */
799
    public function setUserIp($userIp)
800
    {
801
        $this->userIp = $userIp;
802
803
        return $this;
804
    }
805
806
    /**
807
     * Get userIp.
808
     *
809
     * @return string
810
     */
811
    public function getUserIp()
812
    {
813
        return $this->userIp;
814
    }
815
816
    /**
817
     * Set sessionId.
818
     *
819
     * @param int $sessionId
820
     *
821
     * @return CWiki
822
     */
823
    public function setSessionId($sessionId)
824
    {
825
        $this->sessionId = $sessionId;
826
827
        return $this;
828
    }
829
830
    /**
831
     * Get sessionId.
832
     *
833
     * @return int
834
     */
835
    public function getSessionId()
836
    {
837
        return $this->sessionId;
838
    }
839
840
    /**
841
     * Set id.
842
     *
843
     * @param int $id
844
     *
845
     * @return CWiki
846
     */
847
    public function setId($id)
848
    {
849
        $this->id = $id;
850
851
        return $this;
852
    }
853
854
    /**
855
     * Get id.
856
     *
857
     * @return int
858
     */
859
    public function getId()
860
    {
861
        return $this->id;
862
    }
863
864
    public function getIid(): int
865
    {
866
        return $this->iid;
867
    }
868
869
    /**
870
     * Set cId.
871
     *
872
     * @param int $cId
873
     *
874
     * @return CWiki
875
     */
876
    public function setCId($cId)
877
    {
878
        $this->cId = $cId;
879
880
        return $this;
881
    }
882
883
    /**
884
     * Get cId.
885
     *
886
     * @return int
887
     */
888
    public function getCId()
889
    {
890
        return $this->cId;
891
    }
892
893
    public function getCategories()
894
    {
895
        return $this->categories;
896
    }
897
898
    public function addCategory(CWikiCategory $category): CWiki
899
    {
900
        $category->addWikiPage($this);
901
        $this->categories->add($category);
902
903
        return $this;
904
    }
905
}
906