Passed
Push — master ( 8d1a37...25babe )
by Julito
22:45
created

CLpView::setProgress()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 1
b 1
f 1
1
<?php
2
3
declare(strict_types=1);
4
5
/* For licensing terms, see /license.txt */
6
7
namespace Chamilo\CourseBundle\Entity;
8
9
use Chamilo\CoreBundle\Entity\Course;
10
use Chamilo\CoreBundle\Entity\Session;
11
use Doctrine\ORM\Mapping as ORM;
12
13
/**
14
 * CLpView.
15
 *
16
 * @ORM\Table(
17
 *     name="c_lp_view",
18
 *     indexes={
19
 *         @ORM\Index(name="course", columns={"c_id"}),
20
 *         @ORM\Index(name="lp_id", columns={"lp_id"}),
21
 *         @ORM\Index(name="session_id", columns={"session_id"})
22
 *     }
23
 * )
24
 * @ORM\Entity
25
 */
26
class CLpView
27
{
28
    /**
29
     * @ORM\Column(name="iid", type="integer")
30
     * @ORM\Id
31
     * @ORM\GeneratedValue
32
     */
33
    protected int $iid;
34
35
    /**
36
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CLp")
37
     * @ORM\JoinColumn(name="lp_id", referencedColumnName="iid", onDelete="CASCADE")
38
     */
39
    protected CLp $lp;
40
41
    /**
42
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course")
43
     * @ORM\JoinColumn(name="c_id", referencedColumnName="id", onDelete="CASCADE")
44
     */
45
    protected Course $course;
46
47
    /**
48
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session")
49
     * @ORM\JoinColumn(name="session_id", referencedColumnName="id", onDelete="CASCADE")
50
     */
51
    protected ?Session $session = null;
52
53
    /**
54
     * @ORM\Column(name="view_count", type="integer", nullable=false)
55
     */
56
    protected int $viewCount;
57
58
    /**
59
     * @ORM\Column(name="last_item", type="integer", nullable=false)
60
     */
61
    protected int $lastItem;
62
63
    /**
64
     * @ORM\Column(name="progress", type="integer", nullable=true)
65
     */
66
    protected ?int $progress = null;
67
68
    public function setViewCount(int $viewCount): self
69
    {
70
        $this->viewCount = $viewCount;
71
72
        return $this;
73
    }
74
75
    /**
76
     * Get viewCount.
77
     *
78
     * @return int
79
     */
80
    public function getViewCount()
81
    {
82
        return $this->viewCount;
83
    }
84
85
    public function setLastItem(int $lastItem): self
86
    {
87
        $this->lastItem = $lastItem;
88
89
        return $this;
90
    }
91
92
    /**
93
     * Get lastItem.
94
     *
95
     * @return int
96
     */
97
    public function getLastItem()
98
    {
99
        return $this->lastItem;
100
    }
101
102
    public function setProgress(int $progress): self
103
    {
104
        $this->progress = $progress;
105
106
        return $this;
107
    }
108
109
    /**
110
     * Get progress.
111
     *
112
     * @return int
113
     */
114
    public function getProgress()
115
    {
116
        return $this->progress;
117
    }
118
119
    public function getLp(): CLp
120
    {
121
        return $this->lp;
122
    }
123
124
    public function setLp(CLp $lp): self
125
    {
126
        $this->lp = $lp;
127
128
        return $this;
129
    }
130
131
    public function getCourse(): Course
132
    {
133
        return $this->course;
134
    }
135
136
    public function setCourse(Course $course): self
137
    {
138
        $this->course = $course;
139
140
        return $this;
141
    }
142
143
    public function getSession(): ?Session
144
    {
145
        return $this->session;
146
    }
147
148
    public function setSession(?Session $session): self
149
    {
150
        $this->session = $session;
151
152
        return $this;
153
    }
154
}
155