|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Fi\CoreBundle\Entity; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Ruoli. |
|
7
|
|
|
*/ |
|
8
|
|
|
class Ruoli |
|
9
|
|
|
{ |
|
10
|
|
|
/** |
|
11
|
|
|
* @var int |
|
12
|
|
|
*/ |
|
13
|
|
|
private $id; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* @var string |
|
17
|
|
|
*/ |
|
18
|
|
|
private $ruolo; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* @var string |
|
22
|
|
|
*/ |
|
23
|
|
|
private $paginainiziale; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* @var \Doctrine\Common\Collections\Collection |
|
27
|
|
|
*/ |
|
28
|
|
|
private $operatoris; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @var \Doctrine\Common\Collections\Collection |
|
32
|
|
|
*/ |
|
33
|
|
|
private $permessis; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* Constructor. |
|
37
|
|
|
*/ |
|
38
|
5 |
|
public function __construct() |
|
39
|
|
|
{ |
|
40
|
5 |
|
$this->operatoris = new \Doctrine\Common\Collections\ArrayCollection(); |
|
41
|
5 |
|
$this->permessis = new \Doctrine\Common\Collections\ArrayCollection(); |
|
|
|
|
|
|
42
|
5 |
|
} |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* Get id. |
|
46
|
|
|
* |
|
47
|
|
|
* @return int |
|
48
|
|
|
*/ |
|
49
|
23 |
|
public function getId() |
|
50
|
|
|
{ |
|
51
|
23 |
|
return $this->id; |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
|
|
* Set ruolo. |
|
56
|
|
|
* |
|
57
|
|
|
* @param string $ruolo |
|
58
|
|
|
* |
|
59
|
|
|
* @return ruoli |
|
60
|
|
|
*/ |
|
61
|
4 |
|
public function setRuolo($ruolo) |
|
62
|
|
|
{ |
|
63
|
4 |
|
$this->ruolo = $ruolo; |
|
64
|
|
|
|
|
65
|
4 |
|
return $this; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* Get ruolo. |
|
70
|
|
|
* |
|
71
|
|
|
* @return string |
|
72
|
|
|
*/ |
|
73
|
2 |
|
public function getRuolo() |
|
74
|
|
|
{ |
|
75
|
2 |
|
return $this->ruolo; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
/** |
|
79
|
|
|
* Set paginainiziale. |
|
80
|
|
|
* |
|
81
|
|
|
* @param string $paginainiziale |
|
82
|
|
|
* |
|
83
|
|
|
* @return ruoli |
|
84
|
|
|
*/ |
|
85
|
4 |
|
public function setPaginainiziale($paginainiziale) |
|
86
|
|
|
{ |
|
87
|
4 |
|
$this->paginainiziale = $paginainiziale; |
|
88
|
|
|
|
|
89
|
4 |
|
return $this; |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
/** |
|
93
|
|
|
* Get paginainiziale. |
|
94
|
|
|
* |
|
95
|
|
|
* @return string |
|
96
|
|
|
*/ |
|
97
|
1 |
|
public function getPaginainiziale() |
|
98
|
|
|
{ |
|
99
|
1 |
|
return $this->paginainiziale; |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
/** |
|
103
|
|
|
* Add operatoris. |
|
104
|
|
|
* |
|
105
|
|
|
* @param \Fi\CoreBundle\Entity\Operatori $operatoris |
|
106
|
|
|
* |
|
107
|
|
|
* @return ruoli |
|
108
|
|
|
*/ |
|
109
|
|
|
public function addOperatori(\Fi\CoreBundle\Entity\Operatori $operatoris) |
|
110
|
|
|
{ |
|
111
|
|
|
$this->operatoris[] = $operatoris; |
|
112
|
|
|
|
|
113
|
|
|
return $this; |
|
114
|
|
|
} |
|
115
|
|
|
|
|
116
|
|
|
/** |
|
117
|
|
|
* Remove operatoris. |
|
118
|
|
|
* |
|
119
|
|
|
* @param \Fi\CoreBundle\Entity\Operatori $operatoris |
|
120
|
|
|
*/ |
|
121
|
|
|
public function removeOperatori(\Fi\CoreBundle\Entity\Operatori $operatoris) |
|
122
|
|
|
{ |
|
123
|
|
|
$this->operatoris->removeElement($operatoris); |
|
124
|
|
|
} |
|
125
|
|
|
|
|
126
|
|
|
/** |
|
127
|
|
|
* Get operatoris. |
|
128
|
|
|
* |
|
129
|
|
|
* @return \Doctrine\Common\Collections\Collection |
|
130
|
|
|
*/ |
|
131
|
|
|
public function getOperatoris() |
|
132
|
|
|
{ |
|
133
|
|
|
return $this->operatoris; |
|
134
|
|
|
} |
|
135
|
|
|
|
|
136
|
|
|
/** |
|
137
|
|
|
* Add permessis. |
|
138
|
|
|
* |
|
139
|
|
|
* @param \Fi\CoreBundle\Entity\Permessi $permessis |
|
140
|
|
|
* |
|
141
|
|
|
* @return ruoli |
|
142
|
|
|
*/ |
|
143
|
|
|
public function addPermessi(\Fi\CoreBundle\Entity\Permessi $permessis) |
|
144
|
|
|
{ |
|
145
|
|
|
$this->permessis[] = $permessis; |
|
146
|
|
|
|
|
147
|
|
|
return $this; |
|
148
|
|
|
} |
|
149
|
|
|
|
|
150
|
|
|
/** |
|
151
|
|
|
* Remove permessis. |
|
152
|
|
|
* |
|
153
|
|
|
* @param \Fi\CoreBundle\Entity\Permessi $permessis |
|
154
|
|
|
*/ |
|
155
|
|
|
public function removePermessi(\Fi\CoreBundle\Entity\Permessi $permessis) |
|
156
|
|
|
{ |
|
157
|
|
|
$this->permessis->removeElement($permessis); |
|
158
|
|
|
} |
|
159
|
|
|
|
|
160
|
|
|
/** |
|
161
|
|
|
* Get permessis. |
|
162
|
|
|
* |
|
163
|
|
|
* @return \Doctrine\Common\Collections\Collection |
|
164
|
|
|
*/ |
|
165
|
|
|
public function getPermessis() |
|
166
|
|
|
{ |
|
167
|
|
|
return $this->permessis; |
|
168
|
|
|
} |
|
169
|
|
|
|
|
170
|
|
|
public function __toString() |
|
171
|
|
|
{ |
|
172
|
|
|
return $this->getRuolo(); |
|
173
|
|
|
} |
|
174
|
|
|
|
|
175
|
|
|
/** |
|
176
|
|
|
* @var bool |
|
177
|
|
|
*/ |
|
178
|
|
|
private $is_superadmin; |
|
179
|
|
|
|
|
180
|
|
|
/** |
|
181
|
|
|
* @var bool |
|
182
|
|
|
*/ |
|
183
|
|
|
private $is_admin; |
|
184
|
|
|
|
|
185
|
|
|
/** |
|
186
|
|
|
* @var bool |
|
187
|
|
|
*/ |
|
188
|
|
|
private $is_user; |
|
189
|
|
|
|
|
190
|
|
|
/** |
|
191
|
|
|
* Set is_superadmin. |
|
192
|
|
|
* |
|
193
|
|
|
* @param bool $isSuperadmin |
|
194
|
|
|
* |
|
195
|
|
|
* @return ruoli |
|
196
|
|
|
*/ |
|
197
|
4 |
|
public function setIsSuperadmin($isSuperadmin) |
|
198
|
|
|
{ |
|
199
|
4 |
|
$this->is_superadmin = $isSuperadmin; |
|
200
|
|
|
|
|
201
|
4 |
|
return $this; |
|
202
|
|
|
} |
|
203
|
|
|
|
|
204
|
|
|
/** |
|
205
|
|
|
* Get is_superadmin. |
|
206
|
|
|
* |
|
207
|
|
|
* @return bool |
|
208
|
|
|
*/ |
|
209
|
5 |
|
public function isSuperadmin() |
|
210
|
|
|
{ |
|
211
|
5 |
|
return $this->is_superadmin; |
|
212
|
|
|
} |
|
213
|
|
|
|
|
214
|
|
|
/** |
|
215
|
|
|
* Set is_admin. |
|
216
|
|
|
* |
|
217
|
|
|
* @param bool $isAdmin |
|
218
|
|
|
* |
|
219
|
|
|
* @return ruoli |
|
220
|
|
|
*/ |
|
221
|
4 |
|
public function setIsAdmin($isAdmin) |
|
222
|
|
|
{ |
|
223
|
4 |
|
$this->is_admin = $isAdmin; |
|
224
|
|
|
|
|
225
|
4 |
|
return $this; |
|
226
|
|
|
} |
|
227
|
|
|
|
|
228
|
|
|
/** |
|
229
|
|
|
* Get is_admin. |
|
230
|
|
|
* |
|
231
|
|
|
* @return bool |
|
232
|
|
|
*/ |
|
233
|
1 |
|
public function isAdmin() |
|
234
|
|
|
{ |
|
235
|
1 |
|
return $this->is_admin; |
|
236
|
|
|
} |
|
237
|
|
|
|
|
238
|
|
|
/** |
|
239
|
|
|
* Set is_user. |
|
240
|
|
|
* |
|
241
|
|
|
* @param bool $isUser |
|
242
|
|
|
* |
|
243
|
|
|
* @return ruoli |
|
244
|
|
|
*/ |
|
245
|
4 |
|
public function setIsUser($isUser) |
|
246
|
|
|
{ |
|
247
|
4 |
|
$this->is_user = $isUser; |
|
248
|
|
|
|
|
249
|
4 |
|
return $this; |
|
250
|
|
|
} |
|
251
|
|
|
|
|
252
|
|
|
/** |
|
253
|
|
|
* Get is_user. |
|
254
|
|
|
* |
|
255
|
|
|
* @return bool |
|
256
|
|
|
*/ |
|
257
|
1 |
|
public function isUser() |
|
258
|
|
|
{ |
|
259
|
1 |
|
return $this->is_user; |
|
260
|
|
|
} |
|
261
|
|
|
} |
|
262
|
|
|
|
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.