SHARE
TWEET

Untitled

a guest Oct 18th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top