Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
AbstractAclPart.php
Go to the documentation of this file.
1<?php
2
4
6
15abstract class AbstractAclPart {
16
22 #[\Ubiquity\attributes\items\Id()]
23 #[\Ubiquity\attributes\items\Column(name:'name',nullable:false,dbType:'varchar(100)')]
24 protected $name;
25
30 #[Transient]
31 protected $type='';
32
33 public function __construct(?string $name = null) {
34 $this->name = $name;
35 }
36
41 public function getName() {
42 return $this->name;
43 }
44
45 public function getId_() {
46 return $this->name;
47 }
48
53 public function setName($name) {
54 $this->name = $name;
55 }
56
57 public function toArray(): array {
58 return \get_object_vars($this);
59 }
60
61 public function fromArray(array $values) {
62 foreach ($values as $k => $v) {
63 $this->$k = $v;
64 }
65 }
66
67 public function __toString() {
68 return $this->name;
69 }
70
74 public function getType(): string {
75 return $this->type;
76 }
77
81 public function setType(?string $type): void {
82 $this->type = $type;
83 }
84
85 public function castAs(string $class) {
86 return unserialize(sprintf('O:%d:"%s"%s', \strlen($class), $class, \strstr(\strstr(\serialize($this), '"'), ':')));
87 }
88}
89
Ubiquity\security\acl\models$AbastractAclElement This class is part of Ubiquity.
$name
@id @column("name"=>"name","nullable"=>false,"dbType"=>"varchar(100)")