Test Failed
Push — master ( 482637...7bef58 )
by Julito
33:32
created

Portfolio::setCourse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nop 1
dl 0
loc 5
rs 9.4285
nc 1
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CoreBundle\Entity;
5
6
use Chamilo\UserBundle\Entity\User;
7
use Doctrine\ORM\Mapping as ORM;
8
9
/**
10
 * Class Portfolio.
11
 *
12
 * @package Chamilo\CoreBundle\Entity
13
 *
14
 * @ORM\Table(
15
 *  name="portfolio",
16
 *  indexes={
17
 *   @ORM\Index(name="user", columns={"user_id"}),
18
 *   @ORM\Index(name="course", columns={"c_id"}),
19
 *   @ORM\Index(name="session", columns={"session_id"}),
20
 *   @ORM\Index(name="category", columns={"category_id"})
21
 *  }
22
 * )
23
 * Add @ to the next line if api_get_configuration_value('allow_portfolio_tool') is true
24
 * @ORM\Entity()
25
 */
26
class Portfolio
27
{
28
    /**
29
     * @var int
30
     *
31
     * @ORM\Column(name="id", type="integer")
32
     * @ORM\Id
33
     * @ORM\GeneratedValue
34
     */
35
    private $id;
36
37
    /**
38
     * @var string
39
     *
40
     * @ORM\Column(name="title", type="string", length=255)
41
     */
42
    private $title;
43
44
    /**
45
     * @var string
46
     * @ORM\Column(name="content", type="text")
47
     */
48
    private $content;
49
50
    /**
51
     * @var User
52
     *
53
     * @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User")
54
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
55
     */
56
    private $user;
57
58
    /**
59
     * @var Course
60
     *
61
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course")
62
     * @ORM\JoinColumn(name="c_id", referencedColumnName="id")
63
     */
64
    private $course = null;
65
66
    /**
67
     * @var Session
68
     *
69
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session")
70
     * @ORM\JoinColumn(name="session_id", referencedColumnName="id")
71
     */
72
    private $session = null;
73
74
    /**
75
     * @var \DateTime
76
     *
77
     * @ORM\Column(name="creation_date", type="datetime")
78
     */
79
    private $creationDate;
80
81
    /**
82
     * @var \DateTime
83
     *
84
     * @ORM\Column(name="update_date", type="datetime")
85
     */
86
    private $updateDate;
87
88
    /**
89
     * @var bool
90
     *
91
     * @ORM\Column(name="is_visible", type="boolean", options={"default": true})
92
     */
93
    private $isVisible = true;
94
95
    /**
96
     * @var \Chamilo\CoreBundle\Entity\PortfolioCategory
97
     *
98
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\PortfolioCategory", inversedBy="items")
99
     * @ORM\JoinColumn(name="category_id", referencedColumnName="id")
100
     */
101
    private $category;
102
103
    /**
104
     * Portfolio constructor.
105
     */
106
    public function __construct()
107
    {
108
        $this->category = new PortfolioCategory();
109
    }
110
111
    /**
112
     * Set user.
113
     *
114
     * @param User $user
115
     *
116
     * @return Portfolio
117
     */
118
    public function setUser(User $user)
119
    {
120
        $this->user = $user;
121
122
        return $this;
123
    }
124
125
    /**
126
     * Get user.
127
     *
128
     * @return User
129
     */
130
    public function getUser()
131
    {
132
        return $this->user;
133
    }
134
135
    /**
136
     * Set course.
137
     *
138
     * @param Course|null $course
139
     *
140
     * @return Portfolio
141
     */
142
    public function setCourse(Course $course = null)
143
    {
144
        $this->course = $course;
145
146
        return $this;
147
    }
148
149
    /**
150
     * Get course.
151
     *
152
     * @return Course
153
     */
154
    public function getCourse()
155
    {
156
        return $this->course;
157
    }
158
159
    /**
160
     * Get session.
161
     *
162
     * @return Session
163
     */
164
    public function getSession()
165
    {
166
        return $this->session;
167
    }
168
169
    /**
170
     * Set session.
171
     *
172
     * @param Session|null $session
173
     *
174
     * @return Portfolio
175
     */
176
    public function setSession(Session $session = null)
177
    {
178
        $this->session = $session;
179
180
        return $this;
181
    }
182
183
    /**
184
     * Set title.
185
     *
186
     * @param string $title
187
     *
188
     * @return Portfolio
189
     */
190
    public function setTitle($title)
191
    {
192
        $this->title = $title;
193
194
        return $this;
195
    }
196
197
    /**
198
     * Get title.
199
     *
200
     * @return string
201
     */
202
    public function getTitle()
203
    {
204
        return $this->title;
205
    }
206
207
    /**
208
     * Set content.
209
     *
210
     * @param string $content
211
     *
212
     * @return Portfolio
213
     */
214
    public function setContent($content)
215
    {
216
        $this->content = $content;
217
218
        return $this;
219
    }
220
221
    /**
222
     * Get content.
223
     *
224
     * @return string
225
     */
226
    public function getContent()
227
    {
228
        return $this->content;
229
    }
230
231
    /**
232
     * Set creationDate.
233
     *
234
     * @param \DateTime $creationDate
235
     *
236
     * @return Portfolio
237
     */
238
    public function setCreationDate(\DateTime $creationDate)
239
    {
240
        $this->creationDate = $creationDate;
241
242
        return $this;
243
    }
244
245
    /**
246
     * Get creationDate.
247
     *
248
     * @return \DateTime
249
     */
250
    public function getCreationDate()
251
    {
252
        return $this->creationDate;
253
    }
254
255
    /**
256
     * Set updateDate.
257
     *
258
     * @param \DateTime $updateDate
259
     *
260
     * @return Portfolio
261
     */
262
    public function setUpdateDate(\DateTime $updateDate)
263
    {
264
        $this->updateDate = $updateDate;
265
266
        return $this;
267
    }
268
269
    /**
270
     * Get updateDate.
271
     *
272
     * @return \DateTime
273
     */
274
    public function getUpdateDate()
275
    {
276
        return $this->updateDate;
277
    }
278
279
    /**
280
     * Get id.
281
     *
282
     * @return int
283
     */
284
    public function getId()
285
    {
286
        return $this->id;
287
    }
288
289
    /**
290
     * Set isVisible.
291
     *
292
     * @param bool $isVisible
293
     *
294
     * @return Portfolio
295
     */
296
    public function setIsVisible($isVisible)
297
    {
298
        $this->isVisible = $isVisible;
299
300
        return $this;
301
    }
302
303
    /**
304
     * Get isVisible.
305
     *
306
     * @return bool
307
     */
308
    public function isVisible()
309
    {
310
        return $this->isVisible;
311
    }
312
313
    /**
314
     * Get category.
315
     *
316
     * @return PortfolioCategory
317
     */
318
    public function getCategory()
319
    {
320
        return $this->category;
321
    }
322
323
    /**
324
     * Set category.
325
     *
326
     * @param PortfolioCategory|null $category
327
     *
328
     * @return Portfolio
329
     */
330
    public function setCategory(PortfolioCategory $category = null)
331
    {
332
        $this->category = $category;
333
334
        return $this;
335
    }
336
}
337