Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
AllowAnnotation.php
Go to the documentation of this file.
1<?php
3
4
6
20
21 public $role;
22
24
25 public $resource;
26
30 public function initAnnotation(array $properties) {
31 if (isset($properties[0])) {
32 $this->role = $properties[0];
33 unset($properties[0]);
34 if (isset($properties[1])) {
35 $this->resource = $properties[1];
36 unset($properties[1]);
37 if (isset($properties[2])) {
38 $this->permission = $properties[2];
39 unset($properties[2]);
40 }
41 }
42 } else if (isset($properties['role'])) {
43 $this->role = $properties['role'];
44 if (isset($properties['resource'])) {
45 $this->resource = $properties['resource'];
46 }
47 if (isset($properties['permission'])) {
48 $this->permission = $properties['permission'];
49 }
50 } else {
51 throw new \Exception('Allow annotation must have a role');
52 }
53 }
54}
initAnnotation(array $properties)
Initialize the annotation.