Runs the query and fetches the results.

@return QueryResultset|Content|null
426116
public function fetch()
    {
        $this->parse();
        $parseEvent = new QueryEvent($this);
        $this->getEntityManager()->getEventManager()->dispatch(QueryEvents::PARSE, $parseEvent);

        $result = call_user_func($this->handlers[$this->getOperation()], $this);
        $executeEvent = new QueryEvent($this, $result);
        $this->getEntityManager()->getEventManager()->dispatch(QueryEvents::EXECUTE, $executeEvent);

        return $result;
    }
1002835
public function fetchFirst(): ?array
    {
        if (!$this->wasExecuted()) {
            $this->exec();
        }

        $this->resetLimit()->limit(0, 1);
        $results = $this->fetchAll();
        return isset($results[0]) ? $results[0] : null;
    }
669037
protected function getQuery()
    {
        // Our final results.
        $finalQueryString = '';

        // Construct query string.
        foreach ($this->query as $key => $value) {
            $finalQueryString .= $key.'='.$value.'&';
        }

        // We have something in the result.
        if (! empty($finalQueryString)) {
            $finalQueryString = rtrim($finalQueryString, '&');
        }

        // We return our results.
        return $finalQueryString;
    }
1166672
public function loadResult()
    {
        // Get the first row from the result set as an array.
        $row = $this->fetchArray();

        if ($row) {
            $row = $row[0];
        }

        // Free up system resources and return.
        $this->freeResult();

        return $row;
    }
108358
public function run()
    {
        $ch = curl_init();

        $query = '';
        if (!empty($this->parameters)) {
            $query = '?' . http_build_query ($this->parameters);
        }
        $this->query = $this->url . $query;
        if ($this->method == "GET") {
            curl_setopt($ch, CURLOPT_URL, $this->url . $query);
        } else {
            curl_setopt($ch, CURLOPT_URL, $this->url);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
        }

        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        foreach ($this->options as $key => $value)
        {
            curl_setopt($ch, $key, $value);
        }

        $this->response = curl_exec($ch);
        $this->curlInfo = curl_getinfo($ch);
        $this->curlError = curl_error($ch);
    }
1314778
public function executeQuery(): IResultSet {
        $temp = null;
        
        if (!$this->build()) {
            throw new \Exception('Error no se pudo construir la sentencia sql');
        }
        
        $temp = $this->conect->query($this->generate);
        $this->generate = "";
        
        if ($temp == null) {
            throw new \Exception('Error no se pudo encontrar nada en la base de datos');
        }
       
        return new ResultSetMYSQL($temp);
    }
802357
public function execute()
    {
        $qe = new QueryExecuter($this->repo, $this->predicate, $this->limit, $this->orderBy);

        return $qe->run();
    }
168685
public function fetch()
    {
        $this->query->where(implode(' AND ', $this->where));
        $record = DB::fetch($this->query);

        if (!$record)
        {
            return null;
        }

        $banner = Banners_Factory::createFromArray($record);
        return $banner;
    }
1143462
public function loadResult()
	{
		// Initialise variables
		$return = null;

		// Execute the query
		if (!$this->execute())
		{
			return null;
		}

		// Get the first row from the result set as an array
		if ($row = $this->fetchArray())
		{
			$return = $row[0];
		}

		// Free up system resources and return
		$this->freeResult();

		return $return;
	}
1245887
public function getResult()
    {
        $result = $this->execute();
        $list = new ArrayCollection;

        //Loop through results
        foreach ($result as $row)
        {
            $entry = array();

            //Loop through entities attributes (or relations)
            foreach ($row as $key => $value)
            {
                $entry[$key] = $this->convertValue($value);
            }

            //Add to list
            $list->add($entry);
        }

        return $list;
    }
1301699
public function getResult()
    {
        if ($this->autoFormat && ! empty($this->object)) {
            return $this->object;
        }

        return $this->content;
    }
238748
public function fetch() {
		if( !$this->fetchLastStatement ) {
			$this->startFetching();
		}
		$row = $this->fetchLastStatement->fetch(\PDO::FETCH_ASSOC);
		if( !$row ) {
			// Last return false, we return null, same effect
			return null;
		}
		if( !$this->fetchIsObject ) {
			return $row;
		}
		$class = $this->class;
		return $class::load($row, true, $this->usingCache);
	}
941129
public function execute() {
        if(is_null($this->client)) {
            $this->client = $this->getConnection();
        }
        if(is_null($this->query)) {
            throw new Exception('No query');
        }

        list($query_data, $meta) = $this->constructQuery($this->source, $this->query, $this->aggs, $this->post_query, $this->settings);

        $results_set = $this->query($query_data, $meta);
        $results = $this->processResults($results_set, $meta);
        $results = $this->postProcessResults($this->post_query, $results, $meta);

        return $results;
    }
549457
public function result()
    {
        $this->fill();
        return $this->results->isEmpty() ? null : $this->results->dequeue();
    }
1215267
public function run()
	{
		$this->resultset = $this->connection->select($this->query);
		$this->numFound = $this->resultset->getNumFound();
		$this->results = $this->getResults();
		$this->resultsFacetSet = $this->resultset->getFacetSet();
		return $this;
	}
469335
final public function next()
    {
        if (!$this->hasNext()) {
            return null;
        }

        $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->next->href);

        $collection = new static($this->client, $result->count, $result->_links);

        foreach ($result->_embedded->{$collection->getCollectionResourceName()} as $dataResult) {
            $collection[] = ResourceFactory::createFromApiResult($dataResult, $this->createResourceObject());
        }

        return $collection;
    }
1229440
public function getQuery()
    {
        $result = null;
        if (isset($this->_data['response']['GeoObjectCollection']['metaDataProperty']['GeocoderResponseMetaData']['request'])) {
            $result = $this->_data['response']['GeoObjectCollection']['metaDataProperty']['GeocoderResponseMetaData']['request'];
        }
        return $result;
    }