예제 #1
0
 /**
  * Rajoute à l'activité de l'utilisateur les notifications suivantes
  * @param array $notif_list liste des ids
  * @param \Entity\User $user
  */
 public function add_new_notif_visited($notif_list, $user)
 {
     $nb = count($notif_list);
     if ($nb > 0) {
         $activity = $user->getActivity();
         if (is_null($activity)) {
             $activity = new \Entity\UserActivity();
             $user->setActivity($activity);
             ci()->doctrine->em->persist($activity);
             ci()->doctrine->em->flush();
             //$activity->setUser($user);
         }
         $activity->add_notification_visited($notif_list);
         ci()->doctrine->em->flush();
     }
     return $nb;
 }