Advertisement
Guest User

Untitled

a guest
Aug 30th, 2015
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Acme\UserBundle\Libs;
  4.  
  5.  
  6. use Doctrine\Bundle\DoctrineBundle\Registry;
  7.  
  8.  
  9. class RegisterTest
  10. {
  11.  
  12. public $doctrine;
  13.  
  14. public function __construct(Registry $doctrine)
  15. {
  16. $this->doctrine = $doctrine;
  17. }
  18.  
  19.  
  20. public function checkUser($argument1)
  21. {
  22. $em = $this->doctrine->getManager();
  23. $user = $em->getRepository('AcmeUserBundle:User')->findOneBy(array('username'=>$argument1));
  24.  
  25.  
  26. if(!$user){
  27. return false;
  28.  
  29. }else{
  30. return true;
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement