1 | <?php |
||
13 | class Permission implements PermissionInterface |
||
14 | { |
||
15 | use FromArray; |
||
16 | |||
17 | private $id; |
||
18 | private $name; |
||
19 | private $guardName; |
||
20 | private $createdAt; |
||
21 | private $updatedAt; |
||
22 | |||
23 | /** |
||
24 | * @return int|null |
||
25 | */ |
||
26 | 23 | public function getId(): ?int |
|
30 | |||
31 | /** |
||
32 | * @param int $id |
||
33 | * @return $this |
||
34 | */ |
||
35 | 21 | public function setId(int $id) |
|
41 | |||
42 | /** |
||
43 | * @return string |
||
44 | */ |
||
45 | 21 | public function getName(): string |
|
49 | |||
50 | /** |
||
51 | * @param string $name |
||
52 | * @return $this |
||
53 | */ |
||
54 | 23 | public function setName(string $name) |
|
60 | |||
61 | /** |
||
62 | * @return string |
||
63 | */ |
||
64 | 21 | public function getGuardName(): string |
|
68 | |||
69 | /** |
||
70 | * @param string $guardName |
||
71 | * @return $this |
||
72 | */ |
||
73 | 23 | public function setGuardName(string $guardName) |
|
79 | |||
80 | /** |
||
81 | * @return string |
||
82 | */ |
||
83 | 3 | public function getCreatedAt(): string |
|
87 | |||
88 | /** |
||
89 | * @param string $createdAt |
||
90 | * @return $this |
||
91 | */ |
||
92 | 21 | public function setCreatedAt(string $createdAt) |
|
98 | |||
99 | /** |
||
100 | * @return string |
||
101 | */ |
||
102 | 3 | public function getUpdatedAt(): string |
|
106 | |||
107 | /** |
||
108 | * @param string $updatedAt |
||
109 | * @return $this |
||
110 | */ |
||
111 | 21 | public function setUpdatedAt(string $updatedAt) |
|
117 | |||
118 | /** |
||
119 | * @param AllPermissionInterface $all |
||
120 | * @return mixed |
||
121 | */ |
||
122 | 1 | public static function all(AllPermissionInterface $all) |
|
126 | |||
127 | /** |
||
128 | * @param FindPermissionInterface $find |
||
129 | * @param array $params |
||
130 | * @return mixed |
||
131 | * @throws Exceptions\PermissionDoesNotExistsException |
||
132 | */ |
||
133 | 4 | public static function find(FindPermissionInterface $find, array $params) |
|
137 | |||
138 | /** |
||
139 | * @return bool |
||
140 | * @throws Exceptions\PermissionAlreadyExistsException |
||
141 | * @throws Exceptions\PermissionDoesNotExistsException |
||
142 | * @throws Exceptions\PermissionNameExistsMustBeUniqueException |
||
143 | */ |
||
144 | 21 | public function save(): bool |
|
148 | |||
149 | /** |
||
150 | * @return bool |
||
151 | * @throws Exceptions\PermissionDoesNotExistsException |
||
152 | * @throws Exceptions\PermissionIsAttachedException |
||
153 | */ |
||
154 | 4 | public function delete(): bool |
|
158 | } |
||
159 |