src/Repository/Doctrine/Repository.php
public function find($id, QueryParameters $queryParameters = null) {
        $q = $this->getQuery(
            $this->createSelectQuery()
                 ->andWhere('o.id = :id')
                 ->setParameter('id', $id),
            $queryParameters
        );

        try {
            return $q->getSingleResult();
        } catch(DoctrineNoResultException $e) {
            throw $this->makeNoResultException($e, $q);
        }
    }
public function find($id, QueryParameters $queryParameters = null) {
        $q = $this->getQuery(
            $this->createSelectQuery()
                 ->andWhere('o.id = :id')
                 ->setParameter('id', $id),
            $queryParameters
        );

        try {
            return $q->getSingleResult();
        } catch(DoctrineNoResultException $e) {
            throw $this->makeNoResultException($e, $q);
        }
    }
Retrieves a single entity.

@param integer         $id
@param QueryParameters $queryParameters an optional array of query scopes
@return object
@throws NoResultException if no result was found