Passed
Push — master ( e64abc...80b3fb )
by Anthony
01:59
created

AccessRight::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace Ribs\RibsAdminBundle\Entity;
4
5
use Doctrine\Common\Collections\ArrayCollection;
1 ignored issue
show
Bug introduced by
The type Doctrine\Common\Collections\ArrayCollection was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * AccessRight
10
 *
11
 * @ORM\Table(name="access_right")
12
 * @ORM\Entity
13
 */
14
class AccessRight
15
{
16
	/**
17
	 * @var integer
18
	 *
19
	 * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true})
20
	 * @ORM\Id
21
	 * @ORM\GeneratedValue(strategy="IDENTITY")
22
	 */
23
	private $id;
24
	
25
	/**
26
	 * @var string
27
	 *
28
	 * @ORM\Column(name="guid", type="string", length=255, nullable=false)
29
	 */
30
	private $guid;
31
	
32
	/**
33
	 * @var string
34
	 *
35
	 * @ORM\Column(name="name", type="string", length=255, nullable=false)
36
	 */
37
	private $name;
38
	
39
	/**
40
	 * @var string
41
	 *
42
	 * @ORM\Column(name="access_rights", type="text", nullable=true)
43
	 */
44
	private $accessRights;
45
	
46
	/**
47
	 * @var \DateTime
48
	 *
49
	 * @ORM\Column(name="creation_date", type="date", nullable=true)
50
	 */
51
	private $creationDate;
52
	
53
	/**
54
	 * @var \DateTime
55
	 *
56
	 * @ORM\Column(name="update_date", type="date", nullable=true)
57
	 */
58
	private $updateDate;
59
	
60
	/**
61
	 * @var ArrayCollection
62
	 *
63
	 * @ORM\OneToMany(targetEntity="Ribs\RibsAdminBundle\Entity\User", mappedBy="accessRightList")
64
	 */
65
	private $users;
66
	
67
	/**
68
	 * AccessRight constructor.
69
	 */
70
	public function __construct()
71
	{
72
		$this->users = new ArrayCollection();
73
	}
74
	
75
	/**
76
	 * @return int
77
	 */
78
	public function getId(): int
79
	{
80
		return $this->id;
81
	}
82
	
83
	/**
84
	 * @param int $id
85
	 */
86
	public function setId(int $id)
87
	{
88
		$this->id = $id;
89
	}
90
	
91
	/**
92
	 * @return string
93
	 */
94
	public function getGuid(): string
95
	{
96
		return $this->guid;
97
	}
98
	
99
	/**
100
	 * @param string $guid
101
	 */
102
	public function setGuid(string $guid)
103
	{
104
		$this->guid = $guid;
105
	}
106
	
107
	/**
108
	 * @return string
109
	 */
110
	public function getName(): string
111
	{
112
		return $this->name;
113
	}
114
	
115
	/**
116
	 * @param string $name
117
	 */
118
	public function setName(string $name)
119
	{
120
		$this->name = $name;
121
	}
122
	
123
	/**
124
	 * @return string
125
	 */
126
	public function getAccessRights(): string
127
	{
128
		return $this->accessRights;
129
	}
130
	
131
	/**
132
	 * @param string $accessRights
133
	 */
134
	public function setAccessRights(string $accessRights)
135
	{
136
		$this->accessRights = $accessRights;
137
	}
138
	
139
	/**
140
	 * @return \DateTime
141
	 */
142
	public function getCreationDate(): \DateTime
143
	{
144
		return $this->creationDate;
145
	}
146
	
147
	/**
148
	 * @param \DateTime $creationDate
149
	 */
150
	public function setCreationDate(\DateTime $creationDate)
151
	{
152
		$this->creationDate = $creationDate;
153
	}
154
	
155
	/**
156
	 * @return \DateTime
157
	 */
158
	public function getUpdateDate(): \DateTime
159
	{
160
		return $this->updateDate;
161
	}
162
	
163
	/**
164
	 * @param \DateTime $updateDate
165
	 */
166
	public function setUpdateDate(\DateTime $updateDate)
167
	{
168
		$this->updateDate = $updateDate;
169
	}
170
	
171
	/**
172
	 * @return ArrayCollection
173
	 */
174
	public function getUsers()
175
	{
176
		return $this->users;
177
	}
178
	
179
	/**
180
	 * @param User $user
181
	 * @return $this
182
	 */
183
	public function addUser(User $user)
184
	{
185
		$this->users[] = $user;
186
		
187
		return $this;
188
	}
189
	
190
	/**
191
	 * @param User $user
192
	 */
193
	public function removeUSer(User $user)
194
	{
195
		$this->users->removeElement($user);
196
	}
197
}