public function addComment($data)
 {
     if ($data) {
         $user_image_id = (int) ImageFacade::findIdUserOfImage($data['image_id']);
         if ($user_image_id !== (int) $data['user_id']) {
             $notiCreate = ['user_from_id' => $data['user_id'], 'user_to_id' => $user_image_id, 'kind' => 'comment', 'seen' => 0];
             $noti = NoticationFacade::createNotication($notiCreate);
         }
         if (isset($noti)) {
             $data['noti_id'] = $noti['id'];
         } else {
             $data['noti_id'] = null;
         }
         $comment = CommentFacade::addComment($data);
         return $comment;
     }
 }
 /**
  * add Like
  */
 public function addLike($data)
 {
     if ($data) {
         $user_id_image = (int) ImageFacade::findIdUserOfImage($data['image_id']);
         if ($user_id_image !== (int) $data['user_id']) {
             $notiInfor = ['user_from_id' => $data['user_id'], 'user_to_id' => $user_id_image, 'kind' => "like", 'seen' => 0];
             $noti = NoticationFacade::createNotication($notiInfor);
         }
         if (isset($noti)) {
             $data['noti_id'] = $noti['id'];
         } else {
             $data['noti_id'] = null;
         }
         $like = LikeFacade::addLike($data);
         return $like;
     }
     return false;
 }
 protected function createNotication($notiInfor)
 {
     return NoticationFacade::createNotication($notiInfor);
 }
 public function getNoticationOfUser($user_id)
 {
     return NoticationFacade::getNoticationOfUser($user_id);
 }