Skip to content

Instantly share code, notes, and snippets.

@jmather
Created November 4, 2012 05:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmather/4010404 to your computer and use it in GitHub Desktop.
Save jmather/4010404 to your computer and use it in GitHub Desktop.
public function isEmailUnique($email_address)
{
$qb = $this->createQueryBuilder('e')
->select('COUNT(e.id)')
->where('e.email_address = :email')
->setParameter('email', $email_address);
$result = $qb->getQuery()->getSingleScalarResult();
if ($result > 0)
return false;
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment