1 | <?php |
||
23 | class Role implements RoleInterface |
||
24 | { |
||
25 | use TimestampableTrait; |
||
26 | |||
27 | /** |
||
28 | * @var mixed |
||
29 | */ |
||
30 | protected $id; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $code; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $name; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $description; |
||
46 | |||
47 | /** |
||
48 | * @var null|RoleInterface |
||
49 | */ |
||
50 | protected $parent; |
||
51 | |||
52 | /** |
||
53 | * @var Collection|RoleInterface[] |
||
54 | */ |
||
55 | protected $children; |
||
56 | |||
57 | /** |
||
58 | * Required by DoctrineExtensions. |
||
59 | * |
||
60 | * @var int |
||
61 | */ |
||
62 | protected $left; |
||
63 | |||
64 | /** |
||
65 | * Required by DoctrineExtensions. |
||
66 | * |
||
67 | * @var int |
||
68 | */ |
||
69 | protected $right; |
||
70 | |||
71 | /** |
||
72 | * Required by DoctrineExtensions. |
||
73 | * |
||
74 | * @var int |
||
75 | */ |
||
76 | protected $level; |
||
77 | |||
78 | /** |
||
79 | * @var Collection|PermissionInterface[] |
||
80 | */ |
||
81 | protected $permissions; |
||
82 | |||
83 | /** |
||
84 | * @var array |
||
85 | */ |
||
86 | protected $securityRoles = array(); |
||
87 | |||
88 | public function __construct() |
||
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | public function __toString() |
||
102 | |||
103 | /** |
||
104 | * {@inheritdoc} |
||
105 | */ |
||
106 | public function getId() |
||
110 | |||
111 | /** |
||
112 | * {@inheritdoc} |
||
113 | */ |
||
114 | public function getCode() |
||
118 | |||
119 | /** |
||
120 | * {@inheritdoc} |
||
121 | */ |
||
122 | public function setCode($code) |
||
126 | |||
127 | /** |
||
128 | * {@inheritdoc} |
||
129 | */ |
||
130 | public function getName() |
||
134 | |||
135 | /** |
||
136 | * {@inheritdoc} |
||
137 | */ |
||
138 | public function setName($name) |
||
142 | |||
143 | /** |
||
144 | * {@inheritdoc} |
||
145 | */ |
||
146 | public function getDescription() |
||
150 | |||
151 | /** |
||
152 | * {@inheritdoc} |
||
153 | */ |
||
154 | public function setDescription($description) |
||
158 | |||
159 | /** |
||
160 | * {@inheritdoc} |
||
161 | */ |
||
162 | public function getParent() |
||
166 | |||
167 | /** |
||
168 | * {@inheritdoc} |
||
169 | */ |
||
170 | public function setParent(RoleInterface $role = null) |
||
174 | |||
175 | /** |
||
176 | * {@inheritdoc} |
||
177 | */ |
||
178 | public function getChildren() |
||
182 | |||
183 | /** |
||
184 | * {@inheritdoc} |
||
185 | */ |
||
186 | public function hasChildren() |
||
190 | |||
191 | /** |
||
192 | * {@inheritdoc} |
||
193 | */ |
||
194 | public function addChild(RoleInterface $role) |
||
201 | |||
202 | /** |
||
203 | * {@inheritdoc} |
||
204 | */ |
||
205 | public function removeChild(RoleInterface $role) |
||
212 | |||
213 | /** |
||
214 | * {@inheritdoc} |
||
215 | */ |
||
216 | public function hasChild(RoleInterface $role) |
||
220 | |||
221 | /** |
||
222 | * {@inheritdoc} |
||
223 | */ |
||
224 | public function getLeft() |
||
228 | |||
229 | /** |
||
230 | * {@inheritdoc} |
||
231 | */ |
||
232 | public function setLeft($left) |
||
236 | |||
237 | /** |
||
238 | * {@inheritdoc} |
||
239 | */ |
||
240 | public function getRight() |
||
244 | |||
245 | /** |
||
246 | * {@inheritdoc} |
||
247 | */ |
||
248 | public function setRight($right) |
||
252 | |||
253 | /** |
||
254 | * {@inheritdoc} |
||
255 | */ |
||
256 | public function getLevel() |
||
260 | |||
261 | /** |
||
262 | * {@inheritdoc} |
||
263 | */ |
||
264 | public function setLevel($level) |
||
268 | |||
269 | /** |
||
270 | * {@inheritdoc} |
||
271 | */ |
||
272 | public function getPermissions() |
||
276 | |||
277 | /** |
||
278 | * {@inheritdoc} |
||
279 | */ |
||
280 | public function addPermission(PermissionInterface $permission) |
||
286 | |||
287 | /** |
||
288 | * {@inheritdoc} |
||
289 | */ |
||
290 | public function removePermission(PermissionInterface $permission) |
||
296 | |||
297 | /** |
||
298 | * {@inheritdoc} |
||
299 | */ |
||
300 | public function hasPermission(PermissionInterface $permission) |
||
304 | |||
305 | /** |
||
306 | * {@inheritdoc} |
||
307 | */ |
||
308 | public function getSecurityRoles() |
||
312 | |||
313 | /** |
||
314 | * {@inheritdoc} |
||
315 | */ |
||
316 | public function setSecurityRoles(array $securityRoles) |
||
320 | } |
||
321 |