1 | <?php |
||
14 | class UpdateOrCreateRole |
||
15 | { |
||
16 | private $exists; |
||
17 | private $create; |
||
18 | private $update; |
||
19 | private $unique; |
||
20 | |||
21 | /** |
||
22 | * UpdateOrCreateRole constructor. |
||
23 | */ |
||
24 | 21 | public function __construct() |
|
31 | |||
32 | /** |
||
33 | * @param Role $role |
||
34 | * @return bool |
||
35 | * @throws RoleAlreadyExistsException |
||
36 | * @throws RoleDoesNotExistsException |
||
37 | * @throws RoleNameExistsMustBeUniqueException |
||
38 | */ |
||
39 | 21 | public function make(Role $role): bool |
|
47 | |||
48 | /** |
||
49 | * @param Role $role |
||
50 | * @return bool |
||
51 | * @throws RoleAlreadyExistsException |
||
52 | */ |
||
53 | 21 | private function create(Role $role): bool |
|
63 | |||
64 | /** |
||
65 | * @param Role $role |
||
66 | * @return bool |
||
67 | * @throws RoleDoesNotExistsException |
||
68 | * @throws RoleNameExistsMustBeUniqueException |
||
69 | */ |
||
70 | 6 | private function update(Role $role): bool |
|
86 | } |
||
87 |