public function runDql($dql, $hydrationMode = \Doctrine\ORM\Query::HYDRATE_OBJECT, $firstResult = null, $maxResult = null)
    {
        /** @var \Doctrine\ORM\Query $query */
        $query = $this->entityManager->createQuery($dql);
        if ($firstResult !== null) {
            $query->setFirstResult($firstResult);
        }
        if ($maxResult !== null) {
            $query->setMaxResults($maxResult);
        }

        return $query->execute([], $hydrationMode);
    }
public function runDql($dql, $hydrationMode = \Doctrine\ORM\Query::HYDRATE_OBJECT, $firstResult = null, $maxResult = null)
    {
        /** @var \Doctrine\ORM\Query $query */
        $query = $this->entityManager->createQuery($dql);
        if ($firstResult !== null) {
            $query->setFirstResult($firstResult);
        }
        if ($maxResult !== null) {
            $query->setMaxResults($maxResult);
        }

        return $query->execute([], $hydrationMode);
    }
public function runDql ( $ dql , $ hydrationMode = \ Doctrine \ ORM \ Query :: HYDRATE_OBJECT , $ firstResult = null , $ maxResult = null ) { /** @var \Doctrine\ORM\Query $query */ $ query = $ this -> entityManager -> createQuery ( $ dql ) ; if ( $ firstResult !== null ) { $ query -> setFirstResult ( $ firstResult ) ; } if ( $ maxResult !== null ) { $ query -> setMaxResults ( $ maxResult ) ; } return $ query -> execute ( [ ] , $ hydrationMode ) ; }
Run DQL and return the result as-is.

@param string $dql
@param integer $hydrationMode
@param integer $firstResult
@param integer $maxResult
@return mixed
Run DQL and return the result as - is .