0

How can I pass userId != 10 in ZF2 and Doctrine?

$entityManager = $this->getEntityManager();
$repository = $entityManager->getRepository('Application\Entity\Usermain');
$emailexists = $repository->findBy(array(
    'userEmail' => $postData['email'],
    'userId!'   => '!'. $postData['id']
));
AlexP
  • 9,906
  • 1
  • 24
  • 43
sangib
  • 1
  • 3
    [Possible duplicate](http://stackoverflow.com/questions/5349790/how-do-i-use-a-complex-criteria-inside-a-doctrine-2-entitys-repository) – AlexP Jul 03 '15 at 13:45
  • Set up a mapper and use the query builder to get this kind of stuff done. It'll really DRY up your code in the long run, and your mappers become memorable places to insert entity to domain logic like this. – Saeven Jul 03 '15 at 17:51

0 Answers0