Пример #1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     if ($this->group_check->show($id)) {
         return BaseController::httpNotFound();
     } else {
         return BaseController::httpContent($this->group_gestion->show($id), 'group');
     }
 }
Пример #2
0
 public function dislikes($id)
 {
     if ($this->vote_check->missingPost($id)) {
         return BaseController::httpNotFound();
     } else {
         return BaseController::httpContent($this->vote_gestion->dislikes($id), 'dislikes');
     }
 }
Пример #3
0
 public function waiting($id)
 {
     if ($this->list_validation->fails()) {
         return BaseController::httpError($this->list_validation);
     } elseif ($this->friend_check->noWaiting($id)) {
         return BaseController::httpNotFound();
     } else {
         return BaseController::httpContent($this->friend_gestion->waiting($id), 'waiting_friends');
     }
 }
Пример #4
0
 public function followers($id)
 {
     if ($this->list_validation->fails()) {
         return BaseController::httpError($this->list_validation);
     }
     if ($this->follow_check->noFollowers($id)) {
         return BaseController::httpNotfound();
     } else {
         return BaseController::httpContent($this->follow_gestion->followers($id), 'followers');
     }
 }
Пример #5
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     if ($this->comment_check->missing($id)) {
         return BaseController::httpNotFound();
     } else {
         return BaseController::httpContent($this->comment_gestion->show($id), 'comment');
     }
 }
Пример #6
0
 public function voteFeed()
 {
     if ($this->list_validation->fails()) {
         return BaseController::httpError($this->list_validation);
     } else {
         return BaseController::httpContent($this->post_gestion->voteFeed(), 'vote_feed');
     }
 }
Пример #7
0
 /**
  * Check if the user exist and has the right password.
  *
  * @return Response
  */
 public function login()
 {
     if ($this->login_validation->fails()) {
         return BaseController::httpError($this->login_validation);
     } else {
         if ($this->user_check->badLogin()) {
             return BaseController::httpNotFound();
         } else {
             return BaseController::httpContent($this->user_gestion->login());
         }
     }
 }