Passed
Push — master ( b9a35c...ab20b0 )
by Julito
15:41
created

CThematicAdvance::getResourceIdentifier()   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
3
/* For licensing terms, see /license.txt */
4
5
namespace Chamilo\CourseBundle\Entity;
6
7
use Chamilo\CoreBundle\Entity\AbstractResource;
8
use Chamilo\CoreBundle\Entity\ResourceInterface;
9
use Chamilo\CoreBundle\Entity\Room;
10
use Doctrine\ORM\Mapping as ORM;
11
12
/**
13
 * CThematicAdvance.
14
 *
15
 * @ORM\Table(
16
 *  name="c_thematic_advance",
17
 *  indexes={
18
 *      @ORM\Index(name="course", columns={"c_id"}),
19
 *      @ORM\Index(name="thematic_id", columns={"thematic_id"})
20
 *  }
21
 * )
22
 * @ORM\Entity
23
 */
24
class CThematicAdvance //extends AbstractResource implements ResourceInterface
25
{
26
    /**
27
     * @var int
28
     *
29
     * @ORM\Column(name="iid", type="integer")
30
     * @ORM\Id
31
     * @ORM\GeneratedValue
32
     */
33
    protected $iid;
34
35
    /**
36
     * @var int
37
     *
38
     * @ORM\Column(name="c_id", type="integer")
39
     */
40
    protected $cId;
41
42
    /**
43
     * @var CThematic
44
     *
45
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CThematic")
46
     * @ORM\JoinColumn(name="thematic_id", referencedColumnName="iid")
47
     */
48
    protected $thematic;
49
50
    /**
51
     * @var CAttendance
52
     *
53
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CAttendance")
54
     * @ORM\JoinColumn(name="attendance_id", referencedColumnName="iid")
55
     */
56
    protected $attendance;
57
58
    /**
59
     * @var string
60
     *
61
     * @ORM\Column(name="content", type="text", nullable=true)
62
     */
63
    protected $content;
64
65
    /**
66
     * @var \DateTime
67
     *
68
     * @ORM\Column(name="start_date", type="datetime", nullable=false)
69
     */
70
    protected $startDate;
71
72
    /**
73
     * @var int
74
     *
75
     * @ORM\Column(name="duration", type="integer", nullable=false)
76
     */
77
    protected $duration;
78
79
    /**
80
     * @var bool
81
     *
82
     * @ORM\Column(name="done_advance", type="boolean", nullable=false)
83
     */
84
    protected $doneAdvance;
85
86
    /**
87
     * @var Room
88
     *
89
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Room")
90
     * @ORM\JoinColumn(name="room_id", referencedColumnName="id")
91
     */
92
    protected $room;
93
94
    public function __construct()
95
    {
96
        $this->doneAdvance = 0;
0 ignored issues
show
Documentation Bug introduced by
The property $doneAdvance was declared of type boolean, but 0 is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
97
        $this->duration = 1;
98
    }
99
100
    public function __toString(): string
101
    {
102
        return (string) $this->getIid();
103
    }
104
105
    /**
106
     * Set content.
107
     *
108
     * @param string $content
109
     *
110
     * @return CThematicAdvance
111
     */
112
    public function setContent($content)
113
    {
114
        $this->content = $content;
115
116
        return $this;
117
    }
118
119
    /**
120
     * Get content.
121
     *
122
     * @return string
123
     */
124
    public function getContent()
125
    {
126
        return $this->content;
127
    }
128
129
    /**
130
     * Set startDate.
131
     *
132
     * @param \DateTime $startDate
133
     *
134
     * @return CThematicAdvance
135
     */
136
    public function setStartDate($startDate)
137
    {
138
        $this->startDate = $startDate;
139
140
        return $this;
141
    }
142
143
    /**
144
     * Get startDate.
145
     *
146
     * @return \DateTime
147
     */
148
    public function getStartDate()
149
    {
150
        return $this->startDate;
151
    }
152
153
    /**
154
     * Set duration.
155
     *
156
     * @param int $duration
157
     *
158
     * @return CThematicAdvance
159
     */
160
    public function setDuration($duration)
161
    {
162
        $this->duration = $duration;
163
164
        return $this;
165
    }
166
167
    /**
168
     * Get duration.
169
     *
170
     * @return int
171
     */
172
    public function getDuration()
173
    {
174
        return $this->duration;
175
    }
176
177
    /**
178
     * Set doneAdvance.
179
     *
180
     * @param bool $doneAdvance
181
     *
182
     * @return CThematicAdvance
183
     */
184
    public function setDoneAdvance($doneAdvance)
185
    {
186
        $this->doneAdvance = $doneAdvance;
187
188
        return $this;
189
    }
190
191
    /**
192
     * Get doneAdvance.
193
     *
194
     * @return bool
195
     */
196
    public function getDoneAdvance()
197
    {
198
        return $this->doneAdvance;
199
    }
200
201
    /**
202
     * Set cId.
203
     *
204
     * @param int $cId
205
     *
206
     * @return CThematicAdvance
207
     */
208
    public function setCId($cId)
209
    {
210
        $this->cId = $cId;
211
212
        return $this;
213
    }
214
215
    /**
216
     * Get cId.
217
     *
218
     * @return int
219
     */
220
    public function getCId()
221
    {
222
        return $this->cId;
223
    }
224
225
    /**
226
     * @return Room
227
     */
228
    public function getRoom()
229
    {
230
        return $this->room;
231
    }
232
233
    /**
234
     * @return $this
235
     */
236
    public function setRoom(Room $room)
237
    {
238
        $this->room = $room;
239
240
        return $this;
241
    }
242
243
    public function getThematic(): CThematic
244
    {
245
        return $this->thematic;
246
    }
247
248
    public function setThematic(CThematic $thematic): self
249
    {
250
        $this->thematic = $thematic;
251
252
        return $this;
253
    }
254
255
    public function getAttendance(): ?CAttendance
256
    {
257
        return $this->attendance;
258
    }
259
260
    public function setAttendance(CAttendance $attendance): self
261
    {
262
        $this->attendance = $attendance;
263
264
        return $this;
265
    }
266
267
    /**
268
     * @return int
269
     */
270
    public function getIid()
271
    {
272
        return $this->iid;
273
    }
274
275
    /*
276
    public function getResourceIdentifier(): int
277
    {
278
        return $this->getIid();
279
    }
280
281
    public function getResourceName(): string
282
    {
283
        return (string) $this->getContent();
284
    }
285
286
    public function setResourceName(string $name): self
287
    {
288
        return $this->setContent($name);
289
    }*/
290
}
291