I need to use doctrine inside my service.
When I try to get it with this code $em = $this->getDoctrine()->getEntityManager(); I catch this error :
Call to undefined method Acme\CrawlerBundle\Services\getTrainingsService::getDoctrine()
How can I finally make the Doctrine work?
You have to pass the entity manager as an argument to your service like this: