Skip to content

Instantly share code, notes, and snippets.

@awartoft
Created November 24, 2012 14:45
Show Gist options
  • Save awartoft/4139947 to your computer and use it in GitHub Desktop.
Save awartoft/4139947 to your computer and use it in GitHub Desktop.
public function yourMethodName()
{
$builder = $this->getEntityManager()->createQueryBuilder();
$builder->from('Module\Entity\Entity', 'entity');
$builder->select('entity');
$builder->leftJoin('entity.relation', 'relation');
$builder->addSelect('relation');
return $builder->getQuery()->getResult();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment