Reputation: 35734
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?
Upvotes: 8
Views: 24368
Reputation: 4161
$user = $this->getDoctrine()
->getRepository('YourBundle:User')
->findOneBy(array('email' => $email));
Please read the official doctrine orm documentation about this
Upvotes: 12