I need to have access to my database anywhere in my application. I have a lot of custom class and object and they need to have access to my database. I tried to extends Controller, or implement ContainerAwareInterface in one of my class, but without success. I want just used the doctrine manager like this any where in my application :
$em = $this->getDoctrine()->getManager();
$em->getRepository('MyTestBundle:Series')->findAllSeries();
I have tried to use services but I don't know how I can use it in all my classes after.