Passed
Push — master ( 6761c6...82c8fb )
by Angel Fernando Quiroz
08:20 queued 13s
created

NotificationRelUser::setId()   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
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\PluginBundle\Entity\CourseHomeNotify;
5
6
use Chamilo\CoreBundle\Entity\User;
7
use Doctrine\ORM\Mapping as ORM;
8
9
#[ORM\Table(name: 'course_home_notify_notification_rel_user')]
10
#[ORM\Entity]
11
class NotificationRelUser
12
{
13
    #[ORM\Column(name: 'id', type: 'integer')]
14
    #[ORM\Id]
15
    #[ORM\GeneratedValue]
16
    private ?int $id = 0;
17
18
    #[ORM\ManyToOne(targetEntity: Notification::class)]
19
    #[ORM\JoinColumn(name: 'notification_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
20
    private Notification $notification;
21
22
    #[ORM\ManyToOne(targetEntity: User::class)]
23
    #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
24
    private User $user;
25
26
    public function getId(): ?int
27
    {
28
        return $this->id;
29
    }
30
31
    public function getNotification(): Notification
32
    {
33
        return $this->notification;
34
    }
35
36
    public function setNotification(Notification $notification): static
37
    {
38
        $this->notification = $notification;
39
40
        return $this;
41
    }
42
43
    public function getUser(): User
44
    {
45
        return $this->user;
46
    }
47
48
    public function setUser(User $user): static
49
    {
50
        $this->user = $user;
51
52
        return $this;
53
    }
54
}
55