Passed
Pull Request — master (#5827)
by
unknown
08:34
created

TicketRelUser::setNotify()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/* For licensing terms, see /license.txt */
6
7
namespace Chamilo\CoreBundle\Entity;
8
9
use Chamilo\CoreBundle\Traits\UserTrait;
10
use Doctrine\ORM\Mapping as ORM;
11
12
#[ORM\Table(name: 'ticket_rel_user')]
13
#[ORM\Entity]
14
class TicketRelUser
15
{
16
    use UserTrait;
17
18
    #[ORM\Id]
19
    #[ORM\ManyToOne(targetEntity: User::class)]
20
    #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
21
    protected User $user;
22
23
    #[ORM\Id]
24
    #[ORM\ManyToOne(targetEntity: Ticket::class)]
25
    #[ORM\JoinColumn(name: 'ticket_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
26
    protected Ticket $ticket;
27
28
    #[ORM\Column(name: 'notify', type: 'boolean', nullable: false)]
29
    protected bool $notify;
30
31
    public function __construct(User $user, Ticket $ticket, bool $notify)
32
    {
33
        $this->user = $user;
34
        $this->ticket = $ticket;
35
        $this->notify = $notify;
36
    }
37
38
    public function getTicket(): Ticket
39
    {
40
        return $this->ticket;
41
    }
42
43
    public function setTicket(Ticket $ticket): self
44
    {
45
        $this->ticket = $ticket;
46
47
        return $this;
48
    }
49
50
    public function isNotify(): bool
51
    {
52
        return $this->notify;
53
    }
54
55
    public function setNotify(bool $notify): self
56
    {
57
        $this->notify = $notify;
58
59
        return $this;
60
    }
61
}
62