Passed
Push — master ( ab20b0...4728a8 )
by Julito
09:22
created

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