Total Complexity | 11 |
Total Lines | 72 |
Duplicated Lines | 0 % |
Coverage | 84% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | abstract class AbstractAclPart { |
||
14 | |||
15 | /** |
||
16 | * |
||
17 | * @id |
||
18 | * @column("name"=>"id","nullable"=>false,"dbType"=>"int(11)") |
||
19 | */ |
||
20 | #[\Ubiquity\attributes\items\Id()] |
||
21 | protected $id; |
||
22 | |||
23 | /** |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $name; |
||
28 | |||
29 | 22 | public function __construct(?string $name = null) { |
|
31 | 22 | } |
|
32 | |||
33 | /** |
||
34 | * |
||
35 | * @return mixed |
||
36 | */ |
||
37 | 22 | public function getName() { |
|
38 | 22 | return $this->name; |
|
39 | } |
||
40 | |||
41 | /** |
||
42 | * |
||
43 | * @param string $name |
||
44 | */ |
||
45 | 4 | public function setName($name) { |
|
46 | 4 | $this->name = $name; |
|
47 | 4 | } |
|
48 | |||
49 | 5 | public function toArray(): array { |
|
50 | 5 | return \get_object_vars($this); |
|
51 | } |
||
52 | |||
53 | 6 | public function fromArray(array $values) { |
|
54 | 6 | foreach ($values as $k => $v) { |
|
55 | 6 | $this->$k = $v; |
|
56 | } |
||
57 | 6 | } |
|
58 | |||
59 | /** |
||
60 | * |
||
61 | * @return mixed |
||
62 | */ |
||
63 | 3 | public function getId() { |
|
64 | 3 | return $this->id; |
|
65 | } |
||
66 | |||
67 | public function getId_() { |
||
68 | return $this->name; |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * |
||
73 | * @param mixed $id |
||
74 | */ |
||
75 | 4 | public function setId($id) { |
|
76 | 4 | $this->id = $id; |
|
77 | 4 | } |
|
78 | |||
79 | public function __toString() { |
||
81 | } |
||
82 | |||
83 | 3 | public function castAs(string $class) { |
|
84 | 3 | return unserialize(sprintf('O:%d:"%s"%s', \strlen($class), $class, \strstr(\strstr(\serialize($this), '"'), ':'))); |
|
85 | } |
||
86 | } |
||
87 | |||
88 |