Reputation: 11474
I am practising with symfony2, I have completed the Symblog Tutorial And Now I have stated creating my own small application. I have created a registration form and Login form. Now I have a lot of doubts about the doctrine queries set, I have never used an MVC architecture.
How to write these queries and where I need to write them. Do I need to write them in Entity (The Model) or Repository or anywhere else ?
Which is the good tutorial to learn firing different queries with doctrine in symfony2 ?
I have created a Registration form and a table (user) to store these details, like i have username and password fields in it. Now I have created another form to login. Can I have an example how can I authenticate the user to login checking with the user table ?
Upvotes: 0
Views: 1113
Reputation: 12694
Start with Symfony2's Doctrine documentation:
http://symfony.com/doc/current/book/doctrine.html
Upvotes: 0
Reputation: 1364
Use the FOSUserBundle.... It handles all user related features. Custom queries are done in it's own repository like UserRepository. Then its linked to the Entity and can be called from the controller with $em->getRepostory('path to entity')->myQuery(). Its all in the Symfony docs.
FOSUserBundle: https://github.com/FriendsOfSymfony/FOSUserBundle
Upvotes: 2