Completed
Push — master ( f77763...d3c71d )
by Julito
11:18
created

CAttendance::getAttendanceWeight()   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 Doctrine\ORM\Mapping as ORM;
10
use Symfony\Component\Validator\Constraints as Assert;
11
12
/**
13
 * CAttendance.
14
 *
15
 * @ORM\Table(
16
 *  name="c_attendance",
17
 *  indexes={
18
 *      @ORM\Index(name="active", columns={"active"})
19
 *  }
20
 * )
21
 * @ORM\Entity
22
 */
23
class CAttendance extends AbstractResource implements ResourceInterface
24
{
25
    /**
26
     * @var int
27
     *
28
     * @ORM\Column(name="iid", type="integer")
29
     * @ORM\Id
30
     * @ORM\GeneratedValue
31
     */
32
    protected $iid;
33
34
    /**
35
     * @var string
36
     * @Assert\NotBlank
37
     * @ORM\Column(name="name", type="text", nullable=false)
38
     */
39
    protected $name;
40
41
    /**
42
     * @var string
43
     *
44
     * @ORM\Column(name="description", type="text", nullable=true)
45
     */
46
    protected $description;
47
48
    /**
49
     * @var int
50
     *
51
     * @ORM\Column(name="active", type="integer", nullable=false)
52
     */
53
    protected $active;
54
55
    /**
56
     * @var string
57
     *
58
     * @ORM\Column(name="attendance_qualify_title", type="string", length=255, nullable=true)
59
     */
60
    protected $attendanceQualifyTitle;
61
62
    /**
63
     * @var int
64
     *
65
     * @ORM\Column(name="attendance_qualify_max", type="integer", nullable=false)
66
     */
67
    protected $attendanceQualifyMax;
68
69
    /**
70
     * @var float
71
     *
72
     * @ORM\Column(name="attendance_weight", type="float", precision=6, scale=2, nullable=false)
73
     */
74
    protected $attendanceWeight;
75
76
    /**
77
     * @var int
78
     *
79
     * @ORM\Column(name="locked", type="integer", nullable=false)
80
     */
81
    protected $locked;
82
83
    public function __construct()
84
    {
85
        $this->active = 1;
86
        $this->attendanceQualifyMax = 0;
87
        $this->locked = 0;
88
    }
89
90
    public function __toString(): string
91
    {
92
        return (string) $this->getIid();
93
    }
94
95
    /**
96
     * Set name.
97
     *
98
     * @param string $name
99
     *
100
     * @return CAttendance
101
     */
102
    public function setName($name)
103
    {
104
        $this->name = $name;
105
106
        return $this;
107
    }
108
109
    /**
110
     * Get name.
111
     *
112
     * @return string
113
     */
114
    public function getName()
115
    {
116
        return $this->name;
117
    }
118
119
    /**
120
     * Set description.
121
     *
122
     * @param string $description
123
     *
124
     * @return CAttendance
125
     */
126
    public function setDescription($description)
127
    {
128
        $this->description = $description;
129
130
        return $this;
131
    }
132
133
    /**
134
     * Get description.
135
     *
136
     * @return string
137
     */
138
    public function getDescription()
139
    {
140
        return $this->description;
141
    }
142
143
    /**
144
     * Set active.
145
     */
146
    public function setActive(int $active): self
147
    {
148
        $this->active = $active;
149
150
        return $this;
151
    }
152
153
    /**
154
     * Get active.
155
     */
156
    public function getActive(): int
157
    {
158
        return (int) $this->active;
159
    }
160
161
    /**
162
     * Set attendanceQualifyTitle.
163
     *
164
     * @param string $attendanceQualifyTitle
165
     *
166
     * @return CAttendance
167
     */
168
    public function setAttendanceQualifyTitle($attendanceQualifyTitle)
169
    {
170
        $this->attendanceQualifyTitle = $attendanceQualifyTitle;
171
172
        return $this;
173
    }
174
175
    /**
176
     * Get attendanceQualifyTitle.
177
     *
178
     * @return string
179
     */
180
    public function getAttendanceQualifyTitle()
181
    {
182
        return $this->attendanceQualifyTitle;
183
    }
184
185
    /**
186
     * Set attendanceQualifyMax.
187
     *
188
     * @param int $attendanceQualifyMax
189
     */
190
    public function setAttendanceQualifyMax($attendanceQualifyMax): self
191
    {
192
        $this->attendanceQualifyMax = $attendanceQualifyMax;
193
194
        return $this;
195
    }
196
197
    /**
198
     * Get attendanceQualifyMax.
199
     *
200
     * @return int
201
     */
202
    public function getAttendanceQualifyMax()
203
    {
204
        return $this->attendanceQualifyMax;
205
    }
206
207
    /**
208
     * Set attendanceWeight.
209
     *
210
     * @param float $attendanceWeight
211
     */
212
    public function setAttendanceWeight($attendanceWeight): self
213
    {
214
        $this->attendanceWeight = $attendanceWeight;
215
216
        return $this;
217
    }
218
219
    /**
220
     * Get attendanceWeight.
221
     *
222
     * @return float
223
     */
224
    public function getAttendanceWeight()
225
    {
226
        return $this->attendanceWeight;
227
    }
228
229
    /**
230
     * Set locked.
231
     */
232
    public function setLocked(int $locked): self
233
    {
234
        $this->locked = $locked;
235
236
        return $this;
237
    }
238
239
    /**
240
     * Get locked.
241
     *
242
     * @return int
243
     */
244
    public function getLocked()
245
    {
246
        return $this->locked;
247
    }
248
249
    public function getIid(): int
250
    {
251
        return $this->iid;
252
    }
253
254
    /**
255
     * Resource identifier.
256
     */
257
    public function getResourceIdentifier(): int
258
    {
259
        return $this->getIid();
260
    }
261
262
    public function getResourceName(): string
263
    {
264
        return $this->getName();
265
    }
266
267
    public function setResourceName(string $name): self
268
    {
269
        return $this->setName($name);
270
    }
271
}
272