code: private function getBaseQueryBuilder()
      {
          $qb = $this->getQueryBuilder('r', 'r.id');
  
          return $qb
              ->andWhere(
                  $qb->expr()->orX(
                      $qb->expr()->isMemberOf(':country', 'r.countries'),
                      'r.countries IS EMPTY'
                  )
              )
              ->addOrderBy('r.priority', 'DESC');
      }
docs: Returns the base query builder.
  
  @return \Doctrine\ORM\QueryBuilder