src/Repository/Doctrine/ORMRepository.php
public function findOneBy($criteria)
    {
        $criteria = Util::normalizeCriteria($criteria);

        $criteria->setFirstResult(0);
        $criteria->setMaxResults(1);

        $queryBuilder = $this->getQueryBuilder($criteria);

        return $queryBuilder->getQuery()->getOneOrNullResult();
    }
public function findOneBy($criteria)
    {
        $criteria = Util::normalizeCriteria($criteria);

        $criteria->setFirstResult(0);
        $criteria->setMaxResults(1);

        $queryBuilder = $this->getQueryBuilder($criteria);

        return $queryBuilder->getQuery()->getOneOrNullResult();
    }
public function findOneBy ( $ criteria ) { $ criteria = Util :: normalizeCriteria ( $ criteria ) ; $ criteria -> setFirstResult ( 0 ) ; $ criteria -> setMaxResults ( 1 ) ; $ queryBuilder = $ this -> getQueryBuilder ( $ criteria ) ; return $ queryBuilder -> getQuery ( ) -> getOneOrNullResult ( ) ; }
Tries to find a single entity by a set of criteria.

@param array|Criteria $criteria The criteria. The criteria to find the entity by.
@return object|null Returns the entity that is found or null when no entity is found.
@throws \Doctrine\ORM\Query\QueryException
@throws \Doctrine\ORM\NonUniqueResultException
Tries to find a single entity by a set of criteria .