Completed
Push — master ( 20c83d...440e81 )
by Derek Stephen
01:23
created

PassportRole::setUserId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Del\Passport\Entity;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use Doctrine\Common\Collections\Collection;
7
use Doctrine\ORM\Mapping as ORM;
8
9
/**
10
 * @ORM\Entity
11
 */
12
class PassportRole
13
{
14
    /**
15
     * @ORM\Id
16
     * @ORM\Column(type="integer")
17
     * @ORM\GeneratedValue
18
     * @var int $id
19
     */
20
    private $id;
21
22
    /**
23
     * @ORM\Column(type="integer")
24
     * @var int $userId
25
     */
26
    private $userId;
27
28
    /**
29
     * many users have many roles
30
     * @ORM\ManyToOne(targetEntity="Role")
31
     * @ORM\JoinColumn(name="role", referencedColumnName="id")
32
     * @var Role $role
33
     */
34
    private $role;
35
36
    /**
37
     * @ORM\Column(type="integer", nullable=true)
38
     * @var int $entityId
39
     */
40
    private $entityId;
41
42
    /**
43
     * @return int
44
     */
45
    public function getId(): int
46
    {
47
        return $this->id;
48
    }
49
50
    /**
51
     * @param int $id
52
     */
53
    public function setId(int $id): void
54
    {
55
        $this->id = $id;
56
    }
57
58
    /**
59
     * @return int
60
     */
61
    public function getUserId(): int
62
    {
63
        return $this->userId;
64
    }
65
66
    /**
67
     * @param int $userId
68
     */
69
    public function setUserId(int $userId): void
70
    {
71
        $this->userId = $userId;
72
    }
73
74
    /**
75
     * @return Role
76
     */
77
    public function getRole(): Role
78
    {
79
        return $this->role;
80
    }
81
82
    /**
83
     * @param Role $role
84
     */
85
    public function setRole(Role $role): void
86
    {
87
        $this->role = $role;
88
    }
89
90
    /**
91
     * @return int|null
92
     */
93
    public function getEntityId(): ?int
94
    {
95
        return $this->entityId;
96
    }
97
98
    /**
99
     * @param int $entityId
100
     */
101
    public function setEntityId(int $entityId): void
102
    {
103
        $this->entityId = $entityId;
104
    }
105
}