1 | <?php |
||
2 | |||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
3 | |||
4 | namespace BristolSU\ControlDB\Contracts\Models; |
||
5 | |||
6 | |||
7 | use BristolSU\ControlDB\Contracts\Models\Tags\RoleTag; |
||
8 | use Illuminate\Contracts\Support\Arrayable; |
||
9 | use Illuminate\Contracts\Support\Jsonable; |
||
10 | use Illuminate\Support\Collection; |
||
11 | |||
12 | /** |
||
13 | * Represents a role |
||
14 | */ |
||
0 ignored issues
–
show
|
|||
15 | interface Role extends Arrayable, Jsonable |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * Get the ID of the role |
||
20 | * |
||
21 | * @return int |
||
22 | */ |
||
23 | public function id(): int; |
||
24 | |||
25 | /** |
||
26 | * ID of the position the role belongs to |
||
27 | * |
||
28 | * @return mixed |
||
29 | */ |
||
30 | public function positionId(): int; |
||
31 | |||
32 | /** |
||
33 | * ID of the role data provider |
||
34 | * |
||
35 | * @return int |
||
36 | */ |
||
37 | public function dataProviderId(): int; |
||
38 | |||
39 | /** |
||
40 | * ID of the group |
||
41 | * |
||
42 | * @return mixed |
||
43 | */ |
||
44 | public function groupId(): int; |
||
45 | |||
46 | /** |
||
47 | * Set the ID of the group the role belongs to |
||
48 | * |
||
49 | * @param int $groupId |
||
0 ignored issues
–
show
|
|||
50 | */ |
||
0 ignored issues
–
show
|
|||
51 | public function setGroupId(int $groupId): void; |
||
52 | |||
53 | /** |
||
54 | * Set the ID of the position the group belongs to |
||
55 | * |
||
56 | * @param int $positionId |
||
0 ignored issues
–
show
|
|||
57 | */ |
||
0 ignored issues
–
show
|
|||
58 | public function setPositionId(int $positionId): void; |
||
59 | |||
60 | /** |
||
61 | * Set the ID of the data provider |
||
62 | * |
||
63 | * @param int $dataProviderId |
||
0 ignored issues
–
show
|
|||
64 | */ |
||
0 ignored issues
–
show
|
|||
65 | public function setDataProviderId(int $dataProviderId): void; |
||
66 | |||
67 | /** |
||
68 | * Data associated with the role |
||
69 | * |
||
70 | * @return DataRole |
||
71 | */ |
||
72 | public function data(): DataRole; |
||
73 | /** |
||
74 | * Position belonging to the role |
||
75 | * |
||
76 | * @return Position |
||
77 | */ |
||
78 | public function position(): Position; |
||
79 | |||
80 | /** |
||
81 | * Group belonging to the role |
||
82 | * |
||
83 | * @return Group |
||
84 | */ |
||
85 | public function group(): Group; |
||
86 | |||
87 | /** |
||
88 | * Users who occupy the role |
||
89 | * |
||
90 | * @return Collection |
||
91 | */ |
||
92 | public function users(): Collection; |
||
93 | |||
94 | /** |
||
95 | * Tags the role is tagged with |
||
96 | * |
||
97 | * @return Collection |
||
98 | */ |
||
99 | public function tags(): Collection; |
||
100 | |||
101 | /** |
||
102 | * Add a tag to the role |
||
103 | * |
||
104 | * @param RoleTag $roleTag |
||
0 ignored issues
–
show
|
|||
105 | */ |
||
0 ignored issues
–
show
|
|||
106 | public function addTag(RoleTag $roleTag): void; |
||
107 | |||
108 | /** |
||
109 | * Remove a tag from the role |
||
110 | * |
||
111 | * @param RoleTag $roleTag |
||
0 ignored issues
–
show
|
|||
112 | */ |
||
0 ignored issues
–
show
|
|||
113 | public function removeTag(RoleTag $roleTag): void; |
||
114 | |||
115 | /** |
||
116 | * Add a user to the role |
||
117 | * |
||
118 | * @param User $user |
||
0 ignored issues
–
show
|
|||
119 | */ |
||
0 ignored issues
–
show
|
|||
120 | public function addUser(User $user): void; |
||
121 | |||
122 | /** |
||
123 | * Remove a user from the role |
||
124 | * |
||
125 | * @param User $user |
||
0 ignored issues
–
show
|
|||
126 | */ |
||
0 ignored issues
–
show
|
|||
127 | public function removeUser(User $user): void; |
||
128 | } |
||
129 |