Using doctrine in symfony2, i have a simple user model with the following fields:
Username Email Password
How can I load the model based on email address?
$user = $this->getDoctrine() ->getRepository('YourBundle:User') ->findOneBy(array('email' => $email));
Please read the official doctrine orm documentation about this
2.1m questions
2.1m answers
60 comments
57.0k users