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

SkillRelCourse   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 175
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 175
rs 10
c 0
b 0
f 0
wmc 13

13 Methods

Rating   Name   Duplication   Size   Complexity  
A setId() 0 5 1
A getCourse() 0 3 1
A setUpdatedAt() 0 5 1
A getId() 0 3 1
A setSession() 0 5 1
A setSkill() 0 5 1
A setCourse() 0 5 1
A getCreatedAt() 0 3 1
A __construct() 0 4 1
A getSkill() 0 3 1
A getSession() 0 3 1
A setCreatedAt() 0 5 1
A getUpdatedAt() 0 3 1
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\SkillBundle\Entity;
5
6
use Chamilo\CoreBundle\Entity\Course;
7
use Chamilo\CoreBundle\Entity\Session;
8
use Chamilo\CoreBundle\Entity\Skill;
9
use Doctrine\ORM\Mapping as ORM;
10
use Gedmo\Mapping\Annotation as Gedmo;
11
12
/**
13
 * SkillRelCourse.
14
 *
15
 * @ORM\Table(name="skill_rel_course")
16
 * @ORM\Entity // uncomment if api_get_configuration_value('allow_skill_rel_items')
17
 */
18
class SkillRelCourse
19
{
20
    /**
21
     * @var int
22
     *
23
     * @ORM\Column(name="id", type="integer")
24
     * @ORM\Id
25
     * @ORM\GeneratedValue
26
     */
27
    protected $id;
28
29
    /**
30
     * @var Skill
31
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Skill", inversedBy="courses")
32
     * @ORM\JoinColumn(name="skill_id", referencedColumnName="id")
33
     */
34
    protected $skill;
35
36
    /**
37
     * @var Course
38
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="skills", cascade={"persist"})
39
     * @ORM\JoinColumn(name="c_id", referencedColumnName="id", nullable=false)
40
     */
41
    protected $course;
42
43
    /**
44
     * @var Session
45
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session", inversedBy="skills", cascade={"persist"})
46
     * @ORM\JoinColumn(name="session_id", referencedColumnName="id", nullable=false)
47
     */
48
    protected $session;
49
50
    /**
51
     * @var \DateTime
52
     *
53
     * @Gedmo\Timestampable(on="create")
54
     * @ORM\Column(name="created_at", type="datetime")
55
     */
56
    protected $createdAt;
57
58
    /**
59
     * @var \DateTime
60
     *
61
     * @Gedmo\Timestampable(on="update")
62
     * @ORM\Column(name="updated_at", type="datetime")
63
     */
64
    protected $updatedAt;
65
66
    /**
67
     * SkillRelItem constructor.
68
     */
69
    public function __construct()
70
    {
71
        $this->createdAt = new \DateTime('now');
72
        $this->updatedAt = new \DateTime('now');
73
    }
74
75
    /**
76
     * @return int
77
     */
78
    public function getId()
79
    {
80
        return $this->id;
81
    }
82
83
    /**
84
     * @param int $id
85
     *
86
     * @return SkillRelCourse
87
     */
88
    public function setId($id)
89
    {
90
        $this->id = $id;
91
92
        return $this;
93
    }
94
95
    /**
96
     * @return Skill
97
     */
98
    public function getSkill()
99
    {
100
        return $this->skill;
101
    }
102
103
    /**
104
     * @param Skill $skill
105
     *
106
     * @return SkillRelCourse
107
     */
108
    public function setSkill($skill)
109
    {
110
        $this->skill = $skill;
111
112
        return $this;
113
    }
114
115
    /**
116
     * @return Course
117
     */
118
    public function getCourse()
119
    {
120
        return $this->course;
121
    }
122
123
    /**
124
     * @param Course $course
125
     *
126
     * @return SkillRelCourse
127
     */
128
    public function setCourse($course)
129
    {
130
        $this->course = $course;
131
132
        return $this;
133
    }
134
135
    /**
136
     * @return Session
137
     */
138
    public function getSession()
139
    {
140
        return $this->session;
141
    }
142
143
    /**
144
     * @param Session $session
145
     *
146
     * @return SkillRelCourse
147
     */
148
    public function setSession($session)
149
    {
150
        $this->session = $session;
151
152
        return $this;
153
    }
154
155
    /**
156
     * @return \DateTime
157
     */
158
    public function getCreatedAt()
159
    {
160
        return $this->createdAt;
161
    }
162
163
    /**
164
     * @param \DateTime $createdAt
165
     *
166
     * @return SkillRelCourse
167
     */
168
    public function setCreatedAt($createdAt)
169
    {
170
        $this->createdAt = $createdAt;
171
172
        return $this;
173
    }
174
175
    /**
176
     * @return \DateTime
177
     */
178
    public function getUpdatedAt()
179
    {
180
        return $this->updatedAt;
181
    }
182
183
    /**
184
     * @param \DateTime $updatedAt
185
     *
186
     * @return SkillRelCourse
187
     */
188
    public function setUpdatedAt($updatedAt)
189
    {
190
        $this->updatedAt = $updatedAt;
191
192
        return $this;
193
    }
194
}
195