Completed
Push — master ( a3ace3...0ae69c )
by Julito
11:10
created

CExerciseCategory::setCreatedAt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 1
b 0
f 0
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CourseBundle\Entity;
5
6
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
7
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
8
use Doctrine\ORM\Mapping as ORM;
9
use Gedmo\Mapping\Annotation as Gedmo;
10
use Gedmo\Timestampable\Traits\TimestampableEntity;
11
12
/**
13
 * CExerciseCategory.
14
 *
15
 * @ORM\Table(name="c_exercise_category")
16
 * @ORM\Entity(repositoryClass="Gedmo\Sortable\Entity\Repository\SortableRepository")
17
 */
18
class CExerciseCategory extends AbstractResource implements ResourceInterface
19
{
20
    use TimestampableEntity;
21
22
    /**
23
     * @var int
24
     *
25
     * @ORM\Column(name="id", type="bigint")
26
     * @ORM\Id
27
     * @ORM\GeneratedValue
28
     */
29
    protected $id;
30
31
    /**
32
     * @var int
33
     *
34
     * @Gedmo\SortableGroup
35
     *
36
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CExerciseCategory", inversedBy="children")
37
     * @ORM\JoinColumn(referencedColumnName="id", onDelete="SET NULL")
38
     *
39
     * @ORM\Column(name="c_id", type="integer")
40
     */
41
    protected $cId;
42
43
    /**
44
     * @var string
45
     *
46
     * @ORM\Column(name="name", type="string", length=255, nullable=false)
47
     */
48
    protected $name;
49
50
    /**
51
     * @var string
52
     *
53
     * @ORM\Column(name="description", type="text", nullable=true)
54
     */
55
    protected $description;
56
57
    /**
58
     * @Gedmo\SortablePosition
59
     *
60
     * @ORM\Column(name="position", type="integer")
61
     */
62
    protected $position;
63
64
    /**
65
     * Project constructor.
66
     */
67
    public function __construct()
68
    {
69
    }
70
71
    /**
72
     * @return int
73
     */
74
    public function getId()
75
    {
76
        return $this->id;
77
    }
78
79
    /**
80
     * @param int $id
81
     *
82
     * @return CExerciseCategory
83
     */
84
    public function setId($id)
85
    {
86
        $this->id = $id;
87
88
        return $this;
89
    }
90
91
    /**
92
     * @return int
93
     */
94
    public function getCId()
95
    {
96
        return $this->cId;
97
    }
98
99
    /**
100
     * @param int $cId
101
     *
102
     * @return CExerciseCategory
103
     */
104
    public function setCId($cId)
105
    {
106
        $this->cId = $cId;
107
108
        return $this;
109
    }
110
111
    /**
112
     * @return string
113
     */
114
    public function getName()
115
    {
116
        return $this->name;
117
    }
118
119
    /**
120
     * @param string $name
121
     *
122
     * @return CExerciseCategory
123
     */
124
    public function setName($name)
125
    {
126
        $this->name = $name;
127
128
        return $this;
129
    }
130
131
    /**
132
     * @return string
133
     */
134
    public function getDescription()
135
    {
136
        return $this->description;
137
    }
138
139
    /**
140
     * @param string $description
141
     *
142
     * @return CExerciseCategory
143
     */
144
    public function setDescription($description)
145
    {
146
        $this->description = $description;
147
148
        return $this;
149
    }
150
151
    /**
152
     * @return \DateTime
153
     */
154
    public function getCreatedAt()
155
    {
156
        return $this->createdAt;
157
    }
158
159
    /**
160
     * @param \DateTime $createdAt
161
     *
162
     * @return CExerciseCategory
163
     */
164
    public function setCreatedAt($createdAt)
165
    {
166
        $this->createdAt = $createdAt;
0 ignored issues
show
Bug Best Practice introduced by
The property createdAt does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
167
168
        return $this;
169
    }
170
171
    /**
172
     * @return \DateTime
173
     */
174
    public function getUpdatedAt()
175
    {
176
        return $this->updatedAt;
177
    }
178
179
    /**
180
     * @param \DateTime $updatedAt
181
     *
182
     * @return CExerciseCategory
183
     */
184
    public function setUpdatedAt($updatedAt)
185
    {
186
        $this->updatedAt = $updatedAt;
0 ignored issues
show
Bug Best Practice introduced by
The property updatedAt does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
187
188
        return $this;
189
    }
190
191
    /**
192
     * @return mixed
193
     */
194
    public function getPosition()
195
    {
196
        return $this->position;
197
    }
198
199
    /**
200
     * @param mixed $position
201
     *
202
     * @return CExerciseCategory
203
     */
204
    public function setPosition($position)
205
    {
206
        $this->position = $position;
207
208
        return $this;
209
    }
210
211
    /**
212
     * Resource identifier.
213
     *
214
     * @return int
215
     */
216
    public function getResourceIdentifier(): int
217
    {
218
        return $this->getId();
219
    }
220
221
    /**
222
     * @return string
223
     */
224
    public function getResourceName(): string
225
    {
226
        return $this->getName();
227
    }
228
229
    /**
230
     * @return string
231
     */
232
    public function getToolName(): string
233
    {
234
        return 'test_category';
235
    }
236
}
237