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 | public function latestForAdmin(){ |
||
22 | |||
23 | /** |
||
24 | * Mark the given notification id as "read" |
||
25 | * @param int $notificationId |
||
26 | * @return bool |
||
27 | */ |
||
28 | public function markNotificationAsRead($notificationId) |
||
35 | |||
36 | public function all() |
||
40 | |||
41 | public function find($id) |
||
45 | |||
46 | /** |
||
47 | * Get all the notifications for the given user id |
||
48 | * @param int $userId |
||
49 | * @return \Illuminate\Database\Eloquent\Collection |
||
50 | */ |
||
51 | public function allForUser($userId) |
||
55 | |||
56 | /** |
||
57 | * Get all the read notifications for the given user id |
||
58 | * @param int $userId |
||
59 | * @return \Illuminate\Database\Eloquent\Collection |
||
60 | */ |
||
61 | public function allReadForUser($userId) |
||
65 | |||
66 | /** |
||
67 | * Get all the unread notifications for the given user id |
||
68 | * @param int $userId |
||
69 | * @return \Illuminate\Database\Eloquent\Collection |
||
70 | */ |
||
71 | public function allUnreadForUser($userId) |
||
75 | |||
76 | /** |
||
77 | * Delete all the notifications for the given user |
||
78 | * @param int $userId |
||
79 | * @return bool |
||
80 | */ |
||
81 | public function deleteAllForUser($userId) |
||
85 | |||
86 | /** |
||
87 | * Mark all the notifications for the given user as read |
||
88 | * @param int $userId |
||
89 | * @return bool |
||
90 | */ |
||
91 | public function markAllAsReadForUser($userId) |
||
95 | } |
||
96 |