Passed
Push — master ( 221dc3...6b1522 )
by Julito
15:24
created

CAttendanceSheet::setAttendanceCalendarId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
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\User;
8
use Doctrine\ORM\Mapping as ORM;
9
10
/**
11
 * CAttendanceSheet.
12
 *
13
 * @ORM\Table(
14
 *  name="c_attendance_sheet",
15
 *  indexes={
16
 *      @ORM\Index(name="presence", columns={"presence"})
17
 *  }
18
 * )
19
 * @ORM\Entity
20
 */
21
class CAttendanceSheet
22
{
23
    /**
24
     * @var int
25
     *
26
     * @ORM\Column(name="iid", type="integer")
27
     * @ORM\Id
28
     * @ORM\GeneratedValue
29
     */
30
    protected $iid;
31
32
    /**
33
     * @var bool
34
     *
35
     * @ORM\Column(name="presence", type="boolean", nullable=false)
36
     */
37
    protected $presence;
38
39
    /**
40
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User")
41
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
42
     */
43
    protected User $user;
44
45
    /**
46
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CAttendanceCalendar")
47
     * @ORM\JoinColumn(name="attendance_calendar_id", referencedColumnName="iid")
48
     */
49
    protected CAttendanceCalendar $attendanceCalendar;
50
51
    /**
52
     * Set presence.
53
     *
54
     * @param bool $presence
55
     *
56
     * @return CAttendanceSheet
57
     */
58
    public function setPresence($presence)
59
    {
60
        $this->presence = $presence;
61
62
        return $this;
63
    }
64
65
    /**
66
     * Get presence.
67
     *
68
     * @return bool
69
     */
70
    public function getPresence()
71
    {
72
        return $this->presence;
73
    }
74
75
    public function getUser(): User
76
    {
77
        return $this->user;
78
    }
79
80
    public function setUser(User $user): self
81
    {
82
        $this->user = $user;
83
84
        return $this;
85
    }
86
87
    public function getAttendanceCalendar(): CAttendanceCalendar
88
    {
89
        return $this->attendanceCalendar;
90
    }
91
92
    public function setAttendanceCalendar(CAttendanceCalendar $attendanceCalendar): self
93
    {
94
        $this->attendanceCalendar = $attendanceCalendar;
95
96
        return $this;
97
    }
98
}
99