Completed
Push — master ( 44391b...87bc43 )
by Julito
13:49
created

CourseControllerTrait::getCourse()   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
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CourseBundle\Controller;
5
6
use Chamilo\CoreBundle\Entity\Course;
7
use Chamilo\CoreBundle\Entity\Session;
8
9
/**
10
 * Trait CourseControllerTrait.
11
 * Implements the functions defined by the CourseControllerInterface.
12
 */
13
trait CourseControllerTrait
14
{
15
    protected $course;
16
    protected $session;
17
18
    /**
19
     * @return mixed
20
     */
21
    public function setCourse(Course $course)
22
    {
23
        $this->course = $course;
24
    }
25
26
    /**
27
     * @return mixed
28
     */
29
    public function setSession(Session $session)
30
    {
31
        $this->session = $session;
32
    }
33
34
    /**
35
     * @return Course
36
     */
37
    public function getCourse()
38
    {
39
        return $this->course;
40
    }
41
42
    /**
43
     * @return Session
44
     */
45
    public function getSession()
46
    {
47
        return $this->session;
48
    }
49
50
    /**
51
     * @return int
52
     */
53
    public function getSessionId()
54
    {
55
        return $this->session ? $this->getSession()->getId() : 0;
56
    }
57
}
58