Advertisement
Guest User

Untitled

a guest
Apr 4th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. public function connectAction(Request $request)
  2. {
  3. $email = $request->request->get('email');
  4. $password = $request->request->get('password');
  5. $em = $this
  6. ->getDoctrine()
  7. ->getEntityManager();
  8. $user = $em
  9. ->getRepository('MessengerBundle:User')
  10. ->getUserByLogIn($email, $password);
  11. if (!$user) {
  12. return $this->view('User not found :( ', 400);
  13. }
  14. $userInformation = $this
  15. ->get('check_user_connected')
  16. ->getUserMainInformation($user);
  17. $serializer = $this->get('jms_serializer');
  18. $serializer->serialize($userInformation, 'json');
  19. return $this->view($userInformation, 200);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement