Exemplo n.º 1
0
 /**
  * Constructs a SqlQuery instance from the current specifications of the builder.
  *
  * @return SqlQuery
  */
 public function getQuery()
 {
     $query = new SqlQuery($this->em);
     $query->setQueryBuilder($this->qb);
     $query->setResultSetMapping($this->rsm);
     return $query;
 }
Exemplo n.º 2
0
 /**
  * If flag to use walker not set manually we try to figure out if it will not brake query logic
  *
  * @param Query|SqlQuery $query
  *
  * @return bool
  */
 private function useWalker($query)
 {
     if ($query instanceof Query) {
         if (null === $this->shouldUseWalker) {
             return !$query->contains('GROUP BY') && null === $query->getMaxResults();
         }
         return $this->shouldUseWalker;
     }
     return false;
 }