Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // $em is empty, all repositories are empty, data is inside DB
- $q = $em->createQuery('SELECT b FROM Foo\Bar b WHERE b.id=?1'); // Plays a query, that's OK
- $q->setParameter(1, 1);
- $result = $q->getSingleResult();
- $entity = $em->find('Foo\Bar', 1); // No query here, as the Entity is yet in the repo
Add Comment
Please, Sign In to add comment