When I override FOSUserBundle's ProfileController
and add these lines:
$em = $this->getDoctrine()->getManager();
$resultat = $em->getRepository('PublishDemandsBundle:Demands')->findAll();
I get the following error:
Call to undefined method Register\UserBundle\Controller\ProfileController::getDoctrine() in ProfileController.php.
Adding this alias-method to the controller fixed the issue: