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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With