The good solution is to define your UserProvider as a service and pass the DBAL connection (or the EntityManager if you sue the ORM) as an argument. You can also pass the complete container as an argument.
Btw, you should look at https://github.com/FriendsOfSymfony/UserBundle which implements it. On Jan 13, 9:26 pm, Michal_V <[email protected]> wrote: > Hi, > > Is there a proper way how to get configured db connection outside > controller classes? > My use case is implementation of a custom UserProvider class and > retrieving user from database based on username column. > > THanks! -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
