Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <?php
  2.  
  3. class UserController extends BaseController
  4. {
  5. /**
  6. * @QueryParam(name="email", strict=true)
  7. *
  8. * @param string $email
  9. * @return array
  10. */
  11. public function getExistsAction($email)
  12. {
  13. return [
  14. 'result' => $this
  15. ->getUserManager()
  16. ->issetUserByEmail($email),
  17. ];
  18. }
  19.  
  20. /**
  21. * @ParamConverter("userInput")
  22. *
  23. * @param UserInputModel $userInput
  24. * @return array
  25. */
  26. public function postAction(UserInputModel $userInput)
  27. {
  28. $user = $this
  29. ->getUserManager()
  30. ->create($userInput->getEmail(), $userInput->getPassword());
  31. return [
  32. 'user' => $user,
  33. ];
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement