Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class myController extends Controller
- {
- public function indexAction()
- {
- // Start setup logger
- $doctrine = $this->getDoctrine();
- $doctrineConnection = $doctrine->getConnection();
- $stack = new \Doctrine\DBAL\Logging\DebugStack();
- $doctrineConnection->getConfiguration()->setSQLLogger($stack);
- $em = $doctrine->getManager();
- // End setup logger
- /**
- * Execute here all your queries
- * $em->getRepository(...)->find(...)
- */
- return $this->render('somebundle:myBundle:index.html.twig',array(
- 'stack' => $stack
- ));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement