1 | <?php |
||
15 | class Role implements RoleInterface |
||
16 | { |
||
17 | use FromArray; |
||
18 | use PermissionsManager; |
||
19 | |||
20 | private $id; |
||
21 | private $name; |
||
22 | private $guardName; |
||
23 | private $createdAt; |
||
24 | private $updatedAt; |
||
25 | |||
26 | /** |
||
27 | * @return int|null |
||
28 | */ |
||
29 | 22 | public function getId(): ?int |
|
33 | |||
34 | /** |
||
35 | * @param int $id |
||
36 | * @return $this |
||
37 | */ |
||
38 | 21 | public function setId(int $id) |
|
44 | |||
45 | /** |
||
46 | * @return string |
||
47 | */ |
||
48 | 21 | public function getName(): string |
|
52 | |||
53 | /** |
||
54 | * @param string $name |
||
55 | * @return $this |
||
56 | */ |
||
57 | 23 | public function setName(string $name) |
|
63 | |||
64 | /** |
||
65 | * @return string |
||
66 | */ |
||
67 | 21 | public function getGuardName(): string |
|
71 | |||
72 | /** |
||
73 | * @param string $guardName |
||
74 | * @return $this |
||
75 | */ |
||
76 | 23 | public function setGuardName(string $guardName) |
|
82 | |||
83 | /** |
||
84 | * @return string |
||
85 | */ |
||
86 | 5 | public function getCreatedAt(): string |
|
90 | |||
91 | /** |
||
92 | * @param string $createdAt |
||
93 | * @return $this |
||
94 | */ |
||
95 | 21 | public function setCreatedAt(string $createdAt) |
|
101 | |||
102 | /** |
||
103 | * @return string |
||
104 | */ |
||
105 | 5 | public function getUpdatedAt(): string |
|
109 | |||
110 | /** |
||
111 | * @param string $updatedAt |
||
112 | * @return $this |
||
113 | */ |
||
114 | 21 | public function setUpdatedAt(string $updatedAt) |
|
120 | |||
121 | /** |
||
122 | * @return array |
||
123 | */ |
||
124 | 22 | public function getPermissions(): array |
|
128 | |||
129 | /** |
||
130 | * @return array |
||
131 | */ |
||
132 | 21 | public function getPermissionsIds(): array |
|
138 | |||
139 | /** |
||
140 | * @param AllRoleInterface $all |
||
141 | * @return mixed |
||
142 | */ |
||
143 | 1 | public static function all(AllRoleInterface $all) |
|
147 | |||
148 | /** |
||
149 | * @param FindRoleInterface $find |
||
150 | * @param array $params |
||
151 | * @return mixed |
||
152 | * @throws Exceptions\RoleDoesNotExistsException |
||
153 | */ |
||
154 | 4 | public static function find(FindRoleInterface $find, array $params) |
|
158 | |||
159 | /** |
||
160 | * @return bool |
||
161 | * @throws Exceptions\RoleAlreadyExistsException |
||
162 | * @throws Exceptions\RoleDoesNotExistsException |
||
163 | * @throws Exceptions\RoleNameExistsMustBeUniqueException |
||
164 | */ |
||
165 | 21 | public function save(): bool |
|
169 | |||
170 | /** |
||
171 | * @return bool |
||
172 | * @throws Exceptions\RoleDoesNotExistsException |
||
173 | * @throws Exceptions\RoleIsAttachedException |
||
174 | */ |
||
175 | 4 | public function delete(): bool |
|
179 | } |
||
180 |