Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function findOneByIdJoinedToCategory($id)
- {
- $query = $this->getEntityManager()
- ->createQuery(
- 'SELECT p, c FROM BloggerBlogBundle:Post p
- JOIN p.category c
- WHERE p.id = :id'
- )->setParameter('id', $id);
- try {
- return $query->getSingleResult();
- } catch (\Doctrine\ORM\NoResultException $e) {
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment