Doctorine check if record exists in database [duplicate]
问题 This question already has an answer here : Doctrine - check if record exists based on field (1 answer) Closed 4 years ago . I would like to check if a record exist in the database. The only thing it needs to return is true or false. I'm now using the following query to get the record. Is the an other command as getResult() to check if the record exists? return $this->createQueryBuilder('u') ->andWhere('u.email = :email AND u.id != :id') ->setParameter('email', $email) ->setParameter('id',