Get the query executor
@return \pq\Query\ExecutorInterface
337452
function getQueryExecutor() {
		if (!$this->exec) {
			$this->exec = new QueryExecutor($this->conn);
		}
		return $this->exec;
	}
1174584
public function getBuilder()
    {
        $builder = new Query\Builder();
        $builder->setVisitors([
            (new Visitors\KeyVisitor($builder))->setKeys($this->keys)->setBaseTable($this->table),
            new Visitors\GroupVisitor($builder),
            new Visitors\EqVisitor($builder),
            new Visitors\NotEqVisitor($builder),
            new Visitors\GtVisitor($builder),
            new Visitors\GteVisitor($builder),
            new Visitors\LtVisitor($builder),
            new Visitors\LteVisitor($builder),
            new Visitors\CtVisitor($builder),
            new Visitors\SwVisitor($builder),
            new Visitors\EwVisitor($builder),
            new Visitors\AndVisitor($builder),
            new Visitors\OrVisitor($builder),
            new Visitors\NotInVisitor($builder),
            new Visitors\InVisitor($builder),
            new Visitors\NullVisitor($builder),
            new Visitors\NotNullVisitor($builder),
        ]);
        $builder->setFunctions([
            new Functions\ConcatFunction(),
            new Functions\SumFunction(),
        ]);

        return $builder;
    }
942458
private function getCountQuery()
    {
        /** @var Query $countQuery */
        $countQuery = $this->cloneQuery($this->query);

        if (! $countQuery->hasHint(CountWalker::HINT_DISTINCT)) {
            $countQuery->setHint(CountWalker::HINT_DISTINCT, true);
        }

        if ($this->useOutputWalker($countQuery)) {
            $platform = $countQuery->getEntityManager()->getConnection()->getDatabasePlatform(); // law of demeter win

            $rsm = new ResultSetMapping();

            $rsm->addScalarResult($platform->getSQLResultCasing('dctrn_count'), 'count', Type::getType('integer'));

            $countQuery->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, CountOutputWalker::class);
            $countQuery->setResultSetMapping($rsm);
        } else {
            $this->appendTreeWalker($countQuery, CountWalker::class);
            $this->unbindUnusedQueryParams($countQuery);
        }

        $countQuery->setFirstResult(null)->setMaxResults(null);

        return $countQuery;
    }
234046
public function getQueryBuilder($instance = null)
    {
        if (!$instance) {
            $instance = $this->query;
        }

        if ($this->isQueryBuilder()) {
            return $instance;
        }

        return $instance->getQuery();
    }
630396
protected QueryExecutor<S> executor() throws RepositoryException {
        QueryExecutor<S> executor = mExecutor;
        if (executor == null) {
            mExecutor = executor = executorFactory().executor(mFilter, mOrdering, null);
        }
        return executor;
    }
1150288
public static function first()
    {
        $self      = self::getInstance();

        $statement = $self->makeSelect();
        $execute   = $self->exec($statement, []);

        return $execute->fetchObject();
    }
358077
protected function getQuery()
    {
        $query = new Query();

        if ($this->valid()) {
            $query->setQuery(new GtNode($this->dataStore->getIdentifier(), $this->key()));
        }

        $query->setLimit(new LimitNode($this->limit));
        $query->setSort(new SortNode([$this->dataStore->getIdentifier() => SortNode::SORT_ASC]));

        return $query;
    }
643688
public function getQuery()
    {
        return isset($this->query) && $this->query ? $this->query : $this->query = new Query();
    }
98020
public function query() {
    $adapter = $this->getAdapter();
    $sql = $this->getSql();
    // always update offset, since it's most likely not contained in the cache id
    $sql = preg_replace('/OFFSET\s+[0-9]+/i', 'OFFSET '.$this->getRawState(Select::OFFSET), $sql);
    $stmt = $adapter->getDriver()->getConnection()->prepare($sql);
    if (self::$logger->isDebugEnabled()) {
      self::$logger->debug("Execute statement: ".$sql);
      self::$logger->debug($this->getParameters(true));
    }
    return $stmt->execute($this->getParameters(true))->getResource();
  }
1258025
protected function getQueryResult()
    {
        if ($this->queryResult) {
            return $this->queryResult;
        }

        return $this->queryResult = $this->getSelector()
            ->getSelectBuilder()
            ->execute();
    }
952895
public function get()
    {
        $exec = $this->getExecutor();

        $exec->setCommand('hostname');
        $exec->run();

        $output = $exec->getOutput();

        return $output['stdout'];
    }
565442
public function getQueryBuilder() 
    {
        $qb = $this->getEntityManager()->createQueryBuilder();
        $qb->select(array('a'));
        $qb->from('Neobazaar\Entity\Document', 'a');
        $qb->andWhere($qb->expr()->eq('a.documentType', ':paramDocumentType'));
        $qb->setParameter('paramDocumentType', Document::DOCUMENT_TYPE_CLASSIFIED);
        $qb->addOrderBy('a.dateEdit', 'DESC');
        	
        $userId = $this->getParam('user');
        if($userId) {
            $hashids = $this->getServiceLocator()->get('neobazaar.service.hashid');
            $userId = $hashids->decrypt($userId);
            $userId = is_array($userId) ? reset($userId) : $userId;
            $qb->andWhere($qb->expr()->eq('a.user', ':paramUserId'));
            $qb->setParameter('paramUserId', $userId);
        }
        
        
        return $qb;
    }
1088147
public function getStubQueryBuilder()
    {
        if (!isset($this->stubQueryBuilder)) {
            $this->stubQueryBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'querystub');
        }

        return $this->stubQueryBuilder;
    }
970161
final public function getQuery()
    {
        if (null === $this->query) {

            $this->query = $this->buildQuery();

            // Apply conditions.
            foreach ($this->conditions as $statement => $value) {
                $this->applyOperator($this->query, $statement, $value);
            }

            $limit = $this->getLimit();

            if (CursorInterface::LIMIT_NONE !== $limit) {
                $this->query->range($this->getOffset(), $limit);
            }
        }

        return $this->query;
    }
230597
public static function get()
    {
        $self      = self::getInstance();

        $statement = $self->makeSelect();
        $execute   = $self->exec($statement, []);

        return $execute->fetchAll(\PDO::FETCH_CLASS);
    }
301876
public function getQueryBuilder()
    {
        /** @var $queryBuilder QueryBuilder */
        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
            ->getQueryBuilderForTable('tx_gridelements_backend_layout');
        $queryBuilder->getRestrictions()
            ->removeAll()
            ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
            ->add(GeneralUtility::makeInstance(HiddenRestriction::class));
        return $queryBuilder;
    }
1312249
public function get()
    {
        // if exists the where or similar things in the query
        // call the from instance
        if (static::$_instance instanceof Builder) {

            $this->source = static::$_instance->get();
        } else {
            // if not call the parent directly
            $this->source = parent::all();
        }

        if (!static::$nested) {
            return $this->source;
        }

        return $this->to(static::$to);
    }