public function removeOldNotifications($actors)
    {
        foreach ($actors as $actor) {
            $read_notifications = array_diff($actor->notificationIds->toArray(), $actor->newNotificationIds->toArray());
            $date = $this->getService('anahita:domain.attribute.date')->modify('-5 days');
            $query = $this->getService('repos:notifications.notification')
                          ->getQuery()
                          ->id($read_notifications)
                          ->creationTime($date, '<');

            $notifications = $query->fetchSet();

            foreach ($notifications as $notification) {
                $actor->removeNotification($notification);
            }
        }
    }
public function removeOldNotifications($actors)
    {
        foreach ($actors as $actor) {
            $read_notifications = array_diff($actor->notificationIds->toArray(), $actor->newNotificationIds->toArray());
            $date = $this->getService('anahita:domain.attribute.date')->modify('-5 days');
            $query = $this->getService('repos:notifications.notification')
                          ->getQuery()
                          ->id($read_notifications)
                          ->creationTime($date, '<');

            $notifications = $query->fetchSet();

            foreach ($notifications as $notification) {
                $actor->removeNotification($notification);
            }
        }
    }
public function removeOldNotifications ( $ actors ) { foreach ( $ actors as $ actor ) { $ read_notifications = array_diff ( $ actor -> notificationIds -> toArray ( ) , $ actor -> newNotificationIds -> toArray ( ) ) ; $ date = $ this -> getService ( 'anahita:domain.attribute.date' ) -> modify ( '-5 days' ) ; $ query = $ this -> getService ( 'repos:notifications.notification' ) -> getQuery ( ) -> id ( $ read_notifications ) -> creationTime ( $ date , '<' ) ; $ notifications = $ query -> fetchSet ( ) ; foreach ( $ notifications as $ notification ) { $ actor -> removeNotification ( $ notification ) ; } } }
Remove old notifications.

@param array $actor An array of notifiable actors
Remove old notifications .