Created
November 4, 2012 05:08
-
-
Save jmather/4010404 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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