BaseRuoli   A
last analyzed

Complexity

Total Complexity 20

Size/Duplication

Total Lines 275
Duplicated Lines 0 %

Test Coverage

Coverage 58.81%

Importance

Changes 0
Metric Value
eloc 40
dl 0
loc 275
ccs 30
cts 51
cp 0.5881
rs 10
c 0
b 0
f 0
wmc 20

20 Methods

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