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\UserTag; |
||
8 | use Illuminate\Contracts\Support\Arrayable; |
||
9 | use Illuminate\Contracts\Support\Jsonable; |
||
10 | use Illuminate\Support\Collection; |
||
11 | |||
12 | /** |
||
13 | * Interface User |
||
14 | */ |
||
0 ignored issues
–
show
|
|||
15 | interface User extends Arrayable, Jsonable |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * ID of the user |
||
20 | * |
||
21 | * @return mixed |
||
22 | */ |
||
23 | public function id(): int; |
||
24 | |||
25 | /** |
||
26 | * ID of the data provider for the user |
||
27 | * |
||
28 | * @return int |
||
29 | */ |
||
30 | public function dataProviderId(): int; |
||
31 | |||
32 | /** |
||
33 | * Set data provider of the user |
||
34 | * |
||
35 | * @param int $dataProviderId |
||
0 ignored issues
–
show
|
|||
36 | */ |
||
0 ignored issues
–
show
|
|||
37 | public function setDataProviderId(int $dataProviderId): void; |
||
38 | |||
39 | /** |
||
40 | * Get the data attributes for the user |
||
41 | * |
||
42 | * @return DataUser |
||
43 | */ |
||
44 | public function data(): DataUser; |
||
45 | |||
46 | /** |
||
47 | * Tags the user is tagged with |
||
48 | * |
||
49 | * @return Collection |
||
50 | */ |
||
51 | public function tags(): Collection; |
||
52 | |||
53 | /** |
||
54 | * Roles the user owns |
||
55 | * |
||
56 | * @return Collection |
||
57 | */ |
||
58 | public function roles(): Collection; |
||
59 | |||
60 | /** |
||
61 | * Groups the user is a member of |
||
62 | * |
||
63 | * @return Collection |
||
64 | */ |
||
65 | public function groups(): Collection; |
||
66 | |||
67 | /** |
||
68 | * Add a tag to the user |
||
69 | * |
||
70 | * @param UserTag $userTag |
||
0 ignored issues
–
show
|
|||
71 | */ |
||
0 ignored issues
–
show
|
|||
72 | public function addTag(UserTag $userTag): void; |
||
73 | |||
74 | /** |
||
75 | * Remove a tag from the user |
||
76 | * |
||
77 | * @param UserTag $userTag |
||
0 ignored issues
–
show
|
|||
78 | */ |
||
0 ignored issues
–
show
|
|||
79 | public function removeTag(UserTag $userTag): void; |
||
80 | |||
81 | /** |
||
82 | * Add a role to the user |
||
83 | * |
||
84 | * @param Role $role |
||
0 ignored issues
–
show
|
|||
85 | */ |
||
0 ignored issues
–
show
|
|||
86 | public function addRole(Role $role): void; |
||
87 | |||
88 | /** |
||
89 | * Remove a role from the user |
||
90 | * |
||
91 | * @param Role $role |
||
0 ignored issues
–
show
|
|||
92 | */ |
||
0 ignored issues
–
show
|
|||
93 | public function removeRole(Role $role): void; |
||
94 | |||
95 | /** |
||
96 | * Add a group from the user |
||
97 | * |
||
98 | * @param Group $group |
||
0 ignored issues
–
show
|
|||
99 | */ |
||
0 ignored issues
–
show
|
|||
100 | public function addGroup(Group $group): void; |
||
101 | |||
102 | /** |
||
103 | * Remove a group from the user |
||
104 | * |
||
105 | * @param Group $group |
||
0 ignored issues
–
show
|
|||
106 | */ |
||
0 ignored issues
–
show
|
|||
107 | public function removeGroup(Group $group): void; |
||
108 | |||
109 | } |
||
110 |