Completed
Push — 4.1 ( e0bb47...f67e6e )
by Andrea
12:09
created

BaseRuoli::getSuperadmin()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Fi\CoreBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Doctrine\Common\Collections\ArrayCollection;
7
8
/**
9
 * Fi\CoreBundle\Ruoli
10
 *
11
 * @ORM\Entity()
12
 * @ORM\Table(name="Ruoli")
13
 * @ORM\InheritanceType("SINGLE_TABLE")
14
 * @ORM\DiscriminatorColumn(name="discr", type="string")
15
 * @ORM\DiscriminatorMap({"base":"BaseRuoli", "extended":"Ruoli"})
16
 * @SuppressWarnings(PHPMD)
17
 */
18
class BaseRuoli
19
{
20
    /**
21
     * @ORM\Id
22
     * @ORM\Column(type="integer")
23
     * @ORM\GeneratedValue(strategy="AUTO")
24
     */
25
    protected $id;
26
27
    /**
28
     * @ORM\Column(type="string", length=45, nullable=true)
29
     */
30
    protected $ruolo;
31
32
    /**
33
     * @ORM\Column(type="string", length=255, nullable=true)
34
     */
35
    protected $paginainiziale;
36
37
    /**
38
     * @ORM\Column(type="boolean", nullable=true)
39
     */
40
    protected $superadmin;
41
42
    /**
43
     * @ORM\Column(name="`admin`", type="boolean", nullable=true)
44
     */
45
    protected $admin;
46
47
    /**
48
     * @ORM\Column(name="`user`", type="boolean", nullable=true)
49
     */
50
    protected $user;
51
52
    /**
53
     * @ORM\OneToMany(targetEntity="Operatori", mappedBy="ruoli")
54
     * @ORM\JoinColumn(name="id", referencedColumnName="ruoli_id", nullable=false)
55
     */
56
    protected $operatoris;
57
58
    /**
59
     * @ORM\OneToMany(targetEntity="Permessi", mappedBy="ruoli")
60
     * @ORM\JoinColumn(name="id", referencedColumnName="ruoli_id", nullable=false)
61
     */
62
    protected $permessis;
63
64 2
    public function __construct()
65
    {
66 2
        $this->operatoris = new ArrayCollection();
67 2
        $this->permessis = new ArrayCollection();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
68 2
    }
69
70
    /**
71
     * Set the value of id.
72
     *
73
     * @param integer $id
74
     * @return \Fi\CoreBundle\Ruoli
0 ignored issues
show
Bug introduced by
The type Fi\CoreBundle\Ruoli 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...
75
     */
76
    public function setId($id)
77
    {
78
        $this->id = $id;
79
80
        return $this;
81
    }
82
83
    /**
84
     * Get the value of id.
85
     *
86
     * @return integer
87
     */
88 3
    public function getId()
89
    {
90 3
        return $this->id;
91
    }
92
93
    /**
94
     * Set the value of ruolo.
95
     *
96
     * @param string $ruolo
97
     * @return \Fi\CoreBundle\Ruoli
98
     */
99 1
    public function setRuolo($ruolo)
100
    {
101 1
        $this->ruolo = $ruolo;
102
103 1
        return $this;
104
    }
105
106
    /**
107
     * Get the value of ruolo.
108
     *
109
     * @return string
110
     */
111 2
    public function getRuolo()
112
    {
113 2
        return $this->ruolo;
114
    }
115
116
    /**
117
     * Set the value of paginainiziale.
118
     *
119
     * @param string $paginainiziale
120
     * @return \Fi\CoreBundle\Ruoli
121
     */
122 1
    public function setPaginainiziale($paginainiziale)
123
    {
124 1
        $this->paginainiziale = $paginainiziale;
125
126 1
        return $this;
127
    }
128
129
    /**
130
     * Get the value of paginainiziale.
131
     *
132
     * @return string
133
     */
134 2
    public function getPaginainiziale()
135
    {
136 2
        return $this->paginainiziale;
137
    }
138
139
    /**
140
     * Set the value of superadmin.
141
     *
142
     * @param boolean $superadmin
143
     * @return \Fi\CoreBundle\Ruoli
144
     */
145 1
    public function setSuperadmin($superadmin)
146
    {
147 1
        $this->superadmin = $superadmin;
148
149 1
        return $this;
150
    }
151
152
    /**
153
     * Get the value of superadmin.
154
     *
155
     * @return boolean
156
     */
157 1
    public function getSuperadmin()
158
    {
159 1
        return $this->superadmin;
160
    }
161
162
    /**
163
     * Set the value of admin.
164
     *
165
     * @param boolean $admin
166
     * @return \Fi\CoreBundle\Ruoli
167
     */
168 1
    public function setAdmin($admin)
169
    {
170 1
        $this->admin = $admin;
171
172 1
        return $this;
173
    }
174
175
    /**
176
     * Get the value of admin.
177
     *
178
     * @return boolean
179
     */
180 1
    public function getAdmin()
181
    {
182 1
        return $this->admin;
183
    }
184
185
    /**
186
     * Set the value of user.
187
     *
188
     * @param boolean $user
189
     * @return \Fi\CoreBundle\Ruoli
190
     */
191 1
    public function setUser($user)
192
    {
193 1
        $this->user = $user;
194
195 1
        return $this;
196
    }
197
198
    /**
199
     * Get the value of user.
200
     *
201
     * @return boolean
202
     */
203 1
    public function getUser()
204
    {
205 1
        return $this->user;
206
    }
207
208
    /**
209
     * Add Operatori entity to collection (one to many).
210
     *
211
     * @param \Fi\CoreBundle\Operatori $operatori
0 ignored issues
show
Bug introduced by
The type Fi\CoreBundle\Operatori 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...
212
     * @return \Fi\CoreBundle\Ruoli
213
     */
214
    public function addOperatori(Operatori $operatori)
215
    {
216
        $this->operatoris[] = $operatori;
217
218
        return $this;
219
    }
220
221
    /**
222
     * Remove Operatori entity from collection (one to many).
223
     *
224
     * @param \Fi\CoreBundle\Operatori $operatori
225
     * @return \Fi\CoreBundle\Ruoli
226
     */
227
    public function removeOperatori(Operatori $operatori)
228
    {
229
        $this->operatoris->removeElement($operatori);
230
231
        return $this;
232
    }
233
234
    /**
235
     * Get Operatori entity collection (one to many).
236
     *
237
     * @return \Doctrine\Common\Collections\Collection
238
     */
239
    public function getOperatoris()
240
    {
241
        return $this->operatoris;
242
    }
243
244
    /**
245
     * Add Permessi entity to collection (one to many).
246
     *
247
     * @param \Fi\CoreBundle\Permessi $permessi
0 ignored issues
show
Bug introduced by
The type Fi\CoreBundle\Permessi 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...
248
     * @return \Fi\CoreBundle\Ruoli
249
     */
250
    public function addPermessi(Permessi $permessi)
251
    {
252
        $this->permessis[] = $permessi;
253
254
        return $this;
255
    }
256
257
    /**
258
     * Remove Permessi entity from collection (one to many).
259
     *
260
     * @param \Fi\CoreBundle\Permessi $permessi
261
     * @return \Fi\CoreBundle\Ruoli
262
     */
263
    public function removePermessi(Permessi $permessi)
264
    {
265
        $this->permessis->removeElement($permessi);
266
267
        return $this;
268
    }
269
270
    /**
271
     * Get Permessi entity collection (one to many).
272
     *
273
     * @return \Doctrine\Common\Collections\Collection
274
     */
275
    public function getPermessis()
276
    {
277
        return $this->permessis;
278
    }
279
280
    public function __sleep()
281
    {
282
        return array('id', 'ruolo', 'paginainiziale', 'superadmin', 'admin', 'user');
283
    }
284
}
285