Advertisement
krot

Doctrine sql

Aug 19th, 2017
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. $em = $this->getDoctrine()->getManager(); // ...or getEntityManager() prior to Symfony 2.1
  2. $connection = $em->getConnection();
  3. $statement = $connection->prepare("SELECT something FROM somethingelse WHERE id = :id");
  4. $statement->bindValue('id', 123);
  5. $statement->execute();
  6. $results = $statement->fetchAll();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement