Passed
Push — master ( 70e393...45daf5 )
by Julito
09:50
created

AccessUrl::setActive()   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
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CoreBundle\Entity;
5
6
use Chamilo\CoreBundle\Traits\CourseTrait;
7
use Doctrine\ORM\Mapping as ORM;
8
9
/**
10
 * AccessUrl.
11
 *
12
 * @ORM\Table(name="access_url")
13
 * @ORM\Entity(repositoryClass="Chamilo\CoreBundle\Repository\AccessUrlRepository")
14
 */
15
class AccessUrl
16
{
17
    use CourseTrait;
18
19
    /**
20
     * @var int
21
     *
22
     * @ORM\Column(name="id", type="integer", precision=0, scale=0, nullable=false, unique=false)
23
     * @ORM\Id
24
     * @ORM\GeneratedValue(strategy="AUTO")
25
     */
26
    protected $id;
27
28
    /**
29
     * @ORM\OneToMany(targetEntity="AccessUrlRelCourse", mappedBy="url", cascade={"persist"}, orphanRemoval=true)
30
     */
31
    protected $course;
32
33
    /**
34
     * @ORM\OneToMany(targetEntity="AccessUrlRelSession", mappedBy="url", cascade={"persist"}, orphanRemoval=true)
35
     */
36
    protected $session;
37
38
    /**
39
     * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SettingsCurrent", mappedBy="url", cascade={"persist"}, orphanRemoval=true)
40
     */
41
    protected $settings;
42
43
    /**
44
     * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SessionCategory", mappedBy="url", cascade={"persist"}, orphanRemoval=true)
45
     */
46
    protected $sessionCategory;
47
48
    /**
49
     * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\CourseCategory", mappedBy="url", cascade={"persist"}, orphanRemoval=true)
50
     */
51
    protected $courseCategory;
52
53
    /**
54
     * @var string
55
     *
56
     * @ORM\Column(name="url", type="string", length=255, nullable=false, unique=false)
57
     */
58
    protected $url;
59
60
    /**
61
     * @var string
62
     *
63
     * @ORM\Column(name="description", type="text", unique=false)
64
     */
65
    protected $description;
66
67
    /**
68
     * @var int
69
     *
70
     * @ORM\Column(name="active", type="integer", nullable=false, unique=false)
71
     */
72
    protected $active;
73
74
    /**
75
     * @var int
76
     *
77
     * @ORM\Column(name="created_by", type="integer", nullable=false, unique=false)
78
     */
79
    protected $createdBy;
80
81
    /**
82
     * @var \DateTime
83
     *
84
     * @ORM\Column(name="tms", type="datetime", nullable=true)
85
     */
86
    protected $tms;
87
88
    /**
89
     * @var bool
90
     *
91
     * @ORM\Column(name="url_type", type="boolean", nullable=true)
92
     */
93
    protected $urlType;
94
95
    /**
96
     * @var int
97
     *
98
     * @ORM\Column(name="limit_courses", type="integer", nullable=true, unique=false)
99
     */
100
    protected $limitCourses;
101
102
    /**
103
     * @var int
104
     *
105
     * @ORM\Column(name="limit_active_courses", type="integer", nullable=true, unique=false)
106
     */
107
    protected $limitActiveCourses;
108
109
    /**
110
     * @var int
111
     *
112
     * @ORM\Column(name="limit_sessions", type="integer", nullable=true, unique=false)
113
     */
114
    protected $limitSessions;
115
116
    /**
117
     * @var int
118
     *
119
     * @ORM\Column(name="limit_users", type="integer", nullable=true, unique=false)
120
     */
121
    protected $limitUsers;
122
123
    /**
124
     * @var int
125
     *
126
     * @ORM\Column(name="limit_teachers", type="integer", nullable=true, unique=false)
127
     */
128
    protected $limitTeachers;
129
130
    /**
131
     * @var int
132
     *
133
     * @ORM\Column(name="limit_disk_space", type="integer", nullable=true, unique=false)
134
     */
135
    protected $limitDiskSpace;
136
137
    /**
138
     * @var string
139
     *
140
     * @ORM\Column(name="email", type="string", length=255, nullable=true, unique=false)
141
     */
142
    protected $email;
143
144
    /**
145
     * Constructor.
146
     */
147
    public function __construct()
148
    {
149
        $this->tms = new \DateTime();
150
        $this->createdBy = 1;
151
    }
152
153
    /**
154
     * @return string
155
     */
156
    public function __toString()
157
    {
158
        return (string) $this->getUrl();
159
    }
160
161
    /**
162
     * Get id.
163
     *
164
     * @return int
165
     */
166
    public function getId()
167
    {
168
        return $this->id;
169
    }
170
171
    /**
172
     * Set url.
173
     *
174
     * @param string $url
175
     *
176
     * @return AccessUrl
177
     */
178
    public function setUrl($url)
179
    {
180
        $this->url = $url;
181
182
        return $this;
183
    }
184
185
    /**
186
     * Get url.
187
     *
188
     * @return string
189
     */
190
    public function getUrl()
191
    {
192
        return $this->url;
193
    }
194
195
    /**
196
     * Set description.
197
     *
198
     * @param string $description
199
     *
200
     * @return AccessUrl
201
     */
202
    public function setDescription($description)
203
    {
204
        $this->description = $description;
205
206
        return $this;
207
    }
208
209
    /**
210
     * Get description.
211
     *
212
     * @return string
213
     */
214
    public function getDescription()
215
    {
216
        return $this->description;
217
    }
218
219
    /**
220
     * Set active.
221
     *
222
     * @param int $active
223
     *
224
     * @return AccessUrl
225
     */
226
    public function setActive($active)
227
    {
228
        $this->active = $active;
229
230
        return $this;
231
    }
232
233
    /**
234
     * Get active.
235
     *
236
     * @return int
237
     */
238
    public function getActive()
239
    {
240
        return $this->active;
241
    }
242
243
    /**
244
     * Set createdBy.
245
     *
246
     * @param int $createdBy
247
     *
248
     * @return AccessUrl
249
     */
250
    public function setCreatedBy($createdBy)
251
    {
252
        $this->createdBy = $createdBy;
253
254
        return $this;
255
    }
256
257
    /**
258
     * Get createdBy.
259
     *
260
     * @return int
261
     */
262
    public function getCreatedBy()
263
    {
264
        return $this->createdBy;
265
    }
266
267
    /**
268
     * Set tms.
269
     *
270
     * @param \DateTime $tms
271
     *
272
     * @return AccessUrl
273
     */
274
    public function setTms($tms)
275
    {
276
        $this->tms = $tms;
277
278
        return $this;
279
    }
280
281
    /**
282
     * Get tms.
283
     *
284
     * @return \DateTime
285
     */
286
    public function getTms()
287
    {
288
        return $this->tms;
289
    }
290
291
    /**
292
     * Set urlType.
293
     *
294
     * @param bool $urlType
295
     *
296
     * @return AccessUrl
297
     */
298
    public function setUrlType($urlType)
299
    {
300
        $this->urlType = $urlType;
301
302
        return $this;
303
    }
304
305
    /**
306
     * Get urlType.
307
     *
308
     * @return bool
309
     */
310
    public function getUrlType()
311
    {
312
        return $this->urlType;
313
    }
314
315
    /**
316
     * @return int
317
     */
318
    public function getLimitActiveCourses()
319
    {
320
        return $this->limitActiveCourses;
321
    }
322
323
    /**
324
     * @param int $limitActiveCourses
325
     *
326
     * @return AccessUrl
327
     */
328
    public function setLimitActiveCourses($limitActiveCourses)
329
    {
330
        $this->limitActiveCourses = $limitActiveCourses;
331
332
        return $this;
333
    }
334
335
    /**
336
     * @return int
337
     */
338
    public function getLimitSessions()
339
    {
340
        return $this->limitSessions;
341
    }
342
343
    /**
344
     * @param int $limitSessions
345
     *
346
     * @return AccessUrl
347
     */
348
    public function setLimitSessions($limitSessions)
349
    {
350
        $this->limitSessions = $limitSessions;
351
352
        return $this;
353
    }
354
355
    /**
356
     * @return int
357
     */
358
    public function getLimitUsers()
359
    {
360
        return $this->limitUsers;
361
    }
362
363
    /**
364
     * @param int $limitUsers
365
     *
366
     * @return AccessUrl
367
     */
368
    public function setLimitUsers($limitUsers)
369
    {
370
        $this->limitUsers = $limitUsers;
371
372
        return $this;
373
    }
374
375
    /**
376
     * @return int
377
     */
378
    public function getLimitTeachers()
379
    {
380
        return $this->limitTeachers;
381
    }
382
383
    /**
384
     * @param int $limitTeachers
385
     *
386
     * @return AccessUrl
387
     */
388
    public function setLimitTeachers($limitTeachers)
389
    {
390
        $this->limitTeachers = $limitTeachers;
391
392
        return $this;
393
    }
394
395
    /**
396
     * @return int
397
     */
398
    public function getLimitDiskSpace()
399
    {
400
        return $this->limitDiskSpace;
401
    }
402
403
    /**
404
     * @param int $limitDiskSpace
405
     *
406
     * @return AccessUrl
407
     */
408
    public function setLimitDiskSpace($limitDiskSpace)
409
    {
410
        $this->limitDiskSpace = $limitDiskSpace;
411
412
        return $this;
413
    }
414
415
    /**
416
     * @return string
417
     */
418
    public function getEmail()
419
    {
420
        return $this->email;
421
    }
422
423
    /**
424
     * @param string $email
425
     *
426
     * @return AccessUrl
427
     */
428
    public function setEmail($email)
429
    {
430
        $this->email = $email;
431
432
        return $this;
433
    }
434
435
    /**
436
     * @return mixed
437
     */
438
    public function getSettings()
439
    {
440
        return $this->settings;
441
    }
442
443
    /**
444
     * @param mixed $settings
445
     *
446
     * @return AccessUrl
447
     */
448
    public function setSettings($settings)
449
    {
450
        $this->settings = $settings;
451
452
        return $this;
453
    }
454
455
    /**
456
     * @return mixed
457
     */
458
    public function getSessionCategory()
459
    {
460
        return $this->sessionCategory;
461
    }
462
463
    /**
464
     * @param mixed $sessionCategory
465
     *
466
     * @return AccessUrl
467
     */
468
    public function setSessionCategory($sessionCategory)
469
    {
470
        $this->sessionCategory = $sessionCategory;
471
472
        return $this;
473
    }
474
475
    /**
476
     * @return int
477
     */
478
    public function getLimitCourses()
479
    {
480
        return $this->limitCourses;
481
    }
482
483
    /**
484
     * @param int $limitCourses
485
     *
486
     * @return AccessUrl
487
     */
488
    public function setLimitCourses($limitCourses)
489
    {
490
        $this->limitCourses = $limitCourses;
491
492
        return $this;
493
    }
494
}
495