1 | <?php |
||
8 | class UserRepository |
||
9 | { |
||
10 | /** |
||
11 | * Create a new user instance after a valid registration. |
||
12 | * |
||
13 | * @param array $data The data used to create the user. |
||
14 | * |
||
15 | * @return \Xetaravel\Models\User |
||
16 | */ |
||
17 | public static function create(array $data): User |
||
30 | |||
31 | /** |
||
32 | * Update the user informations after a valid update request. |
||
33 | * |
||
34 | * @param array $data The data used to update the user. |
||
35 | * @param \Xetaravel\Models\User $user The user to update. |
||
36 | * |
||
37 | * @return bool |
||
38 | */ |
||
39 | public static function update(array $data, User $user): bool |
||
46 | |||
47 | /** |
||
48 | * Update the user's email after a valid email update. |
||
49 | * |
||
50 | * @param array $data The data used to update the user. |
||
51 | * @param \Xetaravel\Models\User $user The user to update. |
||
52 | * |
||
53 | * @return bool |
||
54 | */ |
||
55 | public static function updateEmail(array $data, User $user): bool |
||
61 | |||
62 | /** |
||
63 | * Update the user's password after a valid password update. |
||
64 | * |
||
65 | * @param array $data The data used to update the user. |
||
66 | * @param \Xetaravel\Models\User $user The user to update. |
||
67 | * |
||
68 | * @return bool |
||
69 | */ |
||
70 | public static function updatePassword(array $data, User $user): bool |
||
76 | |||
77 | /** |
||
78 | * Find the notifications data for the notification sidebar. |
||
79 | * |
||
80 | * @param int $userId The id of the user. |
||
81 | * |
||
82 | * @return array |
||
83 | */ |
||
84 | public static function notificationsData($userId): array |
||
94 | } |
||
95 |