1 | <?php |
||
8 | final class EloquentNotificationRepository extends EloquentBaseRepository implements NotificationRepository |
||
9 | { |
||
10 | /** |
||
11 | * @param int $userId |
||
12 | * @return \Illuminate\Database\Eloquent\Collection |
||
13 | */ |
||
14 | public function latestForUser($userId) |
||
18 | |||
19 | /** |
||
20 | * Mark the given notification id as "read" |
||
21 | * @param int $notificationId |
||
22 | * @return bool |
||
23 | */ |
||
24 | public function markNotificationAsRead($notificationId) |
||
31 | |||
32 | public function all() |
||
33 | { |
||
34 | return $this->model->all(); |
||
|
|||
35 | } |
||
36 | |||
37 | public function find($id) |
||
38 | { |
||
39 | return $this->model->find($id); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * Get all the notifications for the given user id |
||
44 | * @param int $userId |
||
45 | * @return \Illuminate\Database\Eloquent\Collection |
||
46 | */ |
||
47 | public function allForUser($userId) |
||
51 | |||
52 | /** |
||
53 | * Get all the read notifications for the given user id |
||
54 | * @param int $userId |
||
55 | * @return \Illuminate\Database\Eloquent\Collection |
||
56 | */ |
||
57 | public function allReadForUser($userId) |
||
61 | |||
62 | /** |
||
63 | * Get all the unread notifications for the given user id |
||
64 | * @param int $userId |
||
65 | * @return \Illuminate\Database\Eloquent\Collection |
||
66 | */ |
||
67 | public function allUnreadForUser($userId) |
||
71 | |||
72 | /** |
||
73 | * Delete all the notifications for the given user |
||
74 | * @param int $userId |
||
75 | * @return bool |
||
76 | */ |
||
77 | public function deleteAllForUser($userId) |
||
81 | |||
82 | /** |
||
83 | * Mark all the notifications for the given user as read |
||
84 | * @param int $userId |
||
85 | * @return bool |
||
86 | */ |
||
87 | public function markAllAsReadForUser($userId) |
||
91 | } |
||
92 |