Passed
Push — master ( 784f8c...891151 )
by Julito
11:16
created

CLpView::getSession()   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
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 Chamilo\CoreBundle\Entity\User;
12
use Doctrine\ORM\Mapping as ORM;
13
14
/**
15
 * CLpView.
16
 *
17
 * @ORM\Table(
18
 *     name="c_lp_view",
19
 *     indexes={
20
 *         @ORM\Index(name="course", columns={"c_id"}),
21
 *         @ORM\Index(name="lp_id", columns={"lp_id"}),
22
 *         @ORM\Index(name="session_id", columns={"session_id"})
23
 *     }
24
 * )
25
 * @ORM\Entity
26
 */
27
class CLpView
28
{
29
    /**
30
     * @ORM\Column(name="iid", type="integer")
31
     * @ORM\Id
32
     * @ORM\GeneratedValue
33
     */
34
    protected int $iid;
35
36
    /**
37
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User")
38
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
39
     */
40
    protected User $user;
41
42
    /**
43
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CLp")
44
     * @ORM\JoinColumn(name="lp_id", referencedColumnName="iid", onDelete="CASCADE")
45
     */
46
    protected CLp $lp;
47
48
    /**
49
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course")
50
     * @ORM\JoinColumn(name="c_id", referencedColumnName="id", onDelete="CASCADE")
51
     */
52
    protected Course $course;
53
54
    /**
55
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session")
56
     * @ORM\JoinColumn(name="session_id", referencedColumnName="id", onDelete="CASCADE")
57
     */
58
    protected ?Session $session = null;
59
60
    /**
61
     * @ORM\Column(name="view_count", type="integer", nullable=false)
62
     */
63
    protected int $viewCount;
64
65
    /**
66
     * @ORM\Column(name="last_item", type="integer", nullable=false)
67
     */
68
    protected int $lastItem;
69
70
    /**
71
     * @ORM\Column(name="progress", type="integer", nullable=true)
72
     */
73
    protected ?int $progress = null;
74
75
    public function setViewCount(int $viewCount): self
76
    {
77
        $this->viewCount = $viewCount;
78
79
        return $this;
80
    }
81
82
    /**
83
     * Get viewCount.
84
     *
85
     * @return int
86
     */
87
    public function getViewCount()
88
    {
89
        return $this->viewCount;
90
    }
91
92
    public function setLastItem(int $lastItem): self
93
    {
94
        $this->lastItem = $lastItem;
95
96
        return $this;
97
    }
98
99
    /**
100
     * Get lastItem.
101
     *
102
     * @return int
103
     */
104
    public function getLastItem()
105
    {
106
        return $this->lastItem;
107
    }
108
109
    public function setProgress(int $progress): self
110
    {
111
        $this->progress = $progress;
112
113
        return $this;
114
    }
115
116
    /**
117
     * Get progress.
118
     *
119
     * @return int
120
     */
121
    public function getProgress()
122
    {
123
        return $this->progress;
124
    }
125
126
    public function getLp(): CLp
127
    {
128
        return $this->lp;
129
    }
130
131
    public function setLp(CLp $lp): self
132
    {
133
        $this->lp = $lp;
134
135
        return $this;
136
    }
137
138
    public function getCourse(): Course
139
    {
140
        return $this->course;
141
    }
142
143
    public function setCourse(Course $course): self
144
    {
145
        $this->course = $course;
146
147
        return $this;
148
    }
149
150
    public function getSession(): ?Session
151
    {
152
        return $this->session;
153
    }
154
155
    public function setSession(?Session $session): self
156
    {
157
        $this->session = $session;
158
159
        return $this;
160
    }
161
162
    public function getUser(): User
163
    {
164
        return $this->user;
165
    }
166
167
    public function setUser(User $user): self
168
    {
169
        $this->user = $user;
170
171
        return $this;
172
    }
173
}
174