Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'admin@domain.com' for key 'UNIQ_1483A5E9E7927C74'
- public function getSameFriends ($email)
- {
- $q = $this->createQueryBuilder('f');
- $q->select('f')
- ->where('f.email = :email')
- ->setParameter('email', $email);
- return $q->getQuery()->getSingleScalarResult();
- }
- $em = $this->getDoctrine()->getEntityManager();
- $count = $em->getRepository('EMMyFriendsBundle:Friend')
- ->getSameFriends($friend->getEmail());
- if($count != 0)
- {
- $this->get('session')->setFlash('notice', 'There already is a friend with this email!');
- return $this->redirect($this->generateUrl('home_display'));
- }
- No result was found for query although at least one row was expected.
- 500 Internal Server Error - NoResultException
- return count($q->getQuery()->getResult());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement