/** * @brief Remove a notification * * @param NotificationInterface $notification * * @return bool */ public function remove(NotificationInterface $notification) { return (bool) DB::table('notification')->where('id', $notification->getId())->delete(); }
/** * @brief loop through $notifications and remove each NotificationInterface * $notification, then return the $notfications array * * @param array $notifications * @param NotificationInterface $notification * * @return array $notifications */ private function _pruneNotifications($notifications, NotificationInterface $notification) { $result = array(); foreach ($notifications as $obj) { if ($obj->getObject()->getName() == $notification->getObject()->getName() && $obj->getActor()->getName() == $notification->getActor()->getName()) { $result[] = $obj; } } return $result; }