private function getByCountryAndCustomerQuery()
    {
        if (null === $this->byCountryAndCustomerQuery) {
            $qb = $this->getBaseQueryBuilder();

            $this->byCountryAndCustomerQuery = $qb
                ->andWhere($qb->expr()->eq('r.customer', ':customer'))
                ->getQuery()
                ->setParameter('customer', true)
                ->setMaxResults(1);
        }

        return $this->byCountryAndCustomerQuery;
    }
private function getByCountryAndCustomerQuery()
    {
        if (null === $this->byCountryAndCustomerQuery) {
            $qb = $this->getBaseQueryBuilder();

            $this->byCountryAndCustomerQuery = $qb
                ->andWhere($qb->expr()->eq('r.customer', ':customer'))
                ->getQuery()
                ->setParameter('customer', true)
                ->setMaxResults(1);
        }

        return $this->byCountryAndCustomerQuery;
    }
Returns the "find one by country and customer" query.

@return \Doctrine\ORM\Query