Passed
Push — master ( fc8817...f91339 )
by Angel Fernando Quiroz
10:10 queued 10s
created

NotificationRelUser   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 20
dl 0
loc 44
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setNotification() 0 5 1
A setUser() 0 5 1
A getId() 0 3 1
A getNotification() 0 3 1
A getUser() 0 3 1
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\PluginBundle\CourseHomeNotify\Entity;
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