public function viewedNotifications($notifications)
    {
        $notifications = (array) $notifications;

        $ids = clone $this->newNotificationIds;

        foreach ($notifications as $notification) {
            $ids->offsetUnset($notification->id);
        }

        $this->set('newNotificationIds', $ids);

        $this->save();
    }
public function viewedNotifications($notifications)
    {
        $notifications = (array) $notifications;

        $ids = clone $this->newNotificationIds;

        foreach ($notifications as $notification) {
            $ids->offsetUnset($notification->id);
        }

        $this->set('newNotificationIds', $ids);

        $this->save();
    }
public function viewedNotifications ( $ notifications ) { $ notifications = ( array ) $ notifications ; $ ids = clone $ this -> newNotificationIds ; foreach ( $ notifications as $ notification ) { $ ids -> offsetUnset ( $ notification -> id ) ; } $ this -> set ( 'newNotificationIds' , $ ids ) ; $ this -> save ( ) ; }
Marks the notifications as read.

@param array $notifications An array of notifications
Marks the notifications as read .