Skip to content

Instantly share code, notes, and snippets.

@adrienbrault
Created June 14, 2012 16:28
Show Gist options
  • Select an option

  • Save adrienbrault/2931326 to your computer and use it in GitHub Desktop.

Select an option

Save adrienbrault/2931326 to your computer and use it in GitHub Desktop.
// On utilise toujours ca ....
try {
$result = $qb->getQuery()->getSingleResult();
} catch (NoResultException $e) {
$result = null;
}
// Mais magie, magie, cette méthode non documentée fait la meme chose!
$result = $qb->getQuery()->getOneOrNullResult();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment