Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <?php
  2.  
  3. class myController extends Controller
  4. {
  5. public function indexAction()
  6. {
  7. // Start setup logger
  8. $doctrine = $this->getDoctrine();
  9. $doctrineConnection = $doctrine->getConnection();
  10. $stack = new \Doctrine\DBAL\Logging\DebugStack();
  11. $doctrineConnection->getConfiguration()->setSQLLogger($stack);
  12. $em = $doctrine->getManager();
  13. // End setup logger
  14.  
  15. /**
  16. * Execute here all your queries
  17. * $em->getRepository(...)->find(...)
  18. */
  19.  
  20. return $this->render('somebundle:myBundle:index.html.twig',array(
  21. 'stack' => $stack
  22. ));
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement