Permite haser una lectura de los datos.
@return IResultSet retorna un objeto de typo IResultSet si es todo correcto y null en caso de errores.
188423
public function executeQuery(): IResultSet {
        
        if (!strlen($this->sql) > 0) {
            throw new \Exception('Error sentencia sql no valida');
        }
        
        $temp = $this->conect->query($this->sql);
        $this->sql = "";
        
        if ($temp == null) {
            throw new \Exception('Error no se pudo encontrar nada en la base de datos');
        }
       
        return new ResultSetMYSQL($temp);
    }
544592
public function getResult()
    {
        if ($this->map->currentModel->row instanceof Sql\DataObjects\Result\Row) {
            $criteria = $this->map->currentModel->row->offsetGet($this->map->currentPrimaryKey);
            $condition = [
                $this->map->intermediaryTable . '.' . $this->map->intermediaryCurrentForeignKey => $criteria,
            ];

            $this->map->intermediaryModel->qb
                ->select([
                    $this->map->referenceTable . '.*',
                ])
                ->from($this->map->intermediaryTable)
                ->join($this->map->referenceTable, implode(' = ', [
                    $this->map->referenceTable . '.' . $this->map->referencePrimaryKey,
                    $this->map->intermediaryTable . '.' . $this->map->intermediaryReferenceForeignKey,
                ]));

            if ($result = $this->map->intermediaryModel->findWhere($condition)) {
                return $result;
            }
        }

        return false;
    }
1121729
public function getErrors()
    {
        $diff = array_diff_key($this->_properties, $this->_errors);

        return $this->_errors + (new Collection($diff))
            ->filter(function ($value) {
                return is_array($value) || $value instanceof EntityInterface;
            })
            ->map(function ($value) {
                return $this->_readError($value);
            })
            ->filter()
            ->toArray();
    }
841023
protected function getNextDataSet()
    {
        $set = $this->file->fgetcsv($this->delimiter, $this->enclosure, $this->escape);

        if (is_array($set) && 1 === count($set) && null === $set[0]) {
            if ($this->skipEmptyLines && !$this->file->eof()) {
                return $this->getNextDataSet();
            }

            return null;
        }

        if ($this->removeBom) {
            if (substr($set[0], 0, 3) == pack("CCC", 0xef, 0xbb, 0xbf)) {
                $set[0] = substr($set[0], 3);
            }
            $this->removeBom = false;
        }

        $set = $this->convertEncoding($set);

        $this->line++;

        return $set;
    }
503477
public function formatDatasets()
    {
        // This little boy was commented because it's not compatible
        // in laravel < 5.4
        //
        // return Collection::make($this->datasets)
        //     ->each
        //     ->matchValues(count($this->labels))
        //     ->map
        //     ->format($this->labels)
        //     ->toJson();

        return Encoder::encode(
            Collection::make($this->datasets)
                ->each(function ($dataset) {
                    $dataset->matchValues(count($this->labels));
                })
                ->map(function ($dataset) {
                    return $dataset->format($this->labels);
                })
                ->toArray()
        );
    }
1275153
public function getRandom()
    {
        $this->internalDataListUpdate();
        $count = sizeof($this->internalDataListData);
        if ($count > 0) {
            $index = rand(0, $count - 1);
            if (isset($this->internalDataListData[$index])) {
                return $this->internalDataListUpdateValueIfNeeded($this->internalDataListData, $index);
            }
        }
        return null;
    }
342642
public function results()
    {

        if ($this->classname) {
            $orderAdapter = app(\Antares\Datatables\Adapter\OrderAdapter::class);
            $orderAdapter->setClassname($this->classname);
            $orderAdapter->setEngineInstance($this);

            $groupsFilterAdapter = app(\Antares\Datatables\Adapter\GroupsFilterAdapter::class);
            $groupsFilterAdapter->setClassname($this->classname);
            $groupsFilterAdapter->setEngineInstance($this);
        }
        return $this->query->get();
    }
1198468
public function select(): IResult
    {
        $builder = new SelectBuilder($this);
        $sql = $builder->build();
        if(!$this->isInitQueryType && !$this->isInTransaction())
        {
            $this->queryType = QueryType::READ;
        }
        return $this->execute($sql);
    }
171721
public function getResults()
    {
        $skip = ($this->page-1)*$this->limit;
        
        $cursor = $this->getCursor();
        $cursor->skip($skip);

        $results = array();
        $i = 0;

        while($cursor->valid() && $cursor->current() && $i++ < $this->limit) {

            $object = new $this->modelName();
            $object->writeAttributes($cursor->current());

            $pseudoCursor = new \stdClass();
            foreach ($object as $key => $value) {
                $pseudoCursor->$key = $value;
            }

            $results[] = $pseudoCursor;
            $cursor->skip();
        }

        return $results;
    }
1289048
public function getSmallestImageSet()
    {
        $imageSet = $this->getImageSet();

        $returnSize = PHP_INT_MAX;
        $returnSet = null;

        foreach ($imageSet as $set) {
            $size = $set->width * $set->height;
            if ($size < $returnSize) {
                $returnSize = $size;
                $returnSet = $set;
            }
        }

        if ($returnSet === null) {
            $returnSet = new \stdClass();
            $returnSet->slug = 'original';
        }

        return $returnSet;
    }
810138
final public function search() {
        global $DB;
        if (!is_null($this->results)) {
            return $this->results;
        }

        $this->results = array();
        $this->totalcount = 0;
        $contextlevel = $this->get_itemcontextlevel();
        list($sql, $params) = $this->get_searchsql();
        // Get total number, to avoid some incorrect iterations.
        $countsql = preg_replace('/ORDER BY.*/', '', $sql);
        $totalcourses = $DB->count_records_sql("SELECT COUNT(*) FROM ($countsql) sel", $params);
        if ($totalcourses > 0) {
            // User to be checked is always the same (usually null, get it from first element).
            $firstcap = reset($this->requiredcapabilities);
            $userid = isset($firstcap['user']) ? $firstcap['user'] : null;
            // Extract caps to check, this saves us a bunch of iterations.
            $requiredcaps = array();
            foreach ($this->requiredcapabilities as $cap) {
                $requiredcaps[] = $cap['capability'];
            }
            // Iterate while we have records and haven't reached $this->maxresults.
            $resultset = $DB->get_recordset_sql($sql, $params);
            foreach ($resultset as $result) {
                context_helper::preload_from_record($result);
                $classname = context_helper::get_class_for_level($contextlevel);
                $context = $classname::instance($result->id);
                if (count($requiredcaps) > 0) {
                    if (!has_all_capabilities($requiredcaps, $context, $userid)) {
                        continue;
                    }
                }
                // Check if we are over the limit.
                if ($this->totalcount + 1 > $this->maxresults) {
                    $this->hasmoreresults = true;
                    break;
                }
                // If not, then continue.
                $this->totalcount++;
                $this->results[$result->id] = $result;
            }
            $resultset->close();
        }

        return $this->totalcount;
    }
1338162
protected function getInitializedSearchResultSet(SearchRequest $searchRequest):SearchResultSet
    {
        /** @var $resultSet SearchResultSet */
        $resultSetClass = $this->getResultSetClassName();
        $resultSet = GeneralUtility::makeInstance($resultSetClass);

        $resultSet->setUsedSearchRequest($searchRequest);
        $resultSet->setUsedPage((int)$searchRequest->getPage());
        $resultSet->setUsedResultsPerPage((int)$searchRequest->getResultsPerPage());
        $resultSet->setUsedSearch($this->search);
        return $resultSet;
    }
6524
protected function validateDataMapStore()
    {
        $field = 'data.map';
        $value = $this->getSubmitted($field);

        if (empty($value)) {
            return null;
        }

        $label = $this->translation->text('Map');

        if (!is_array($value) || count($value) != 2) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        if (count($value) != count(array_filter($value, 'is_numeric'))) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        return true;
    }
186581
public function getItems()
    {
        $statement = (null !== $this->c && null !== $this->d) ? $this->getStatementDay() : $this->getStatementPagination();
        $result = $statement->execute((is_array($this->select)) ? $this->select[1] : null);
        $resultSet = clone $this->resultSetPrototype;

        $this->result = $resultSet->initialize($result);

        return $this->result;
    }
848189
public function getFirst()
    {
        if (is_array($this->queryResult)) {
            $queryResult = &$this->queryResult;
        } else {
            $query = clone $this->query;
            $query->setLimit(1);
            $queryResult = $this->dataMapper->mapToObjects($this->persistenceManager->getObjectDataByQuery($query));
        }
        return (isset($queryResult[0])) ? $queryResult[0] : null;
    }
9217
public function getRedoValues()
    {
        static $data;

        if (! $data) {
            $data = array(
                self::REDO_NONE => $this->_('No'),
                self::REDO_ONLY => $this->_('Yes (forget answers)'),
                self::REDO_COPY => $this->_('Yes (keep answers)'));
        }

        return $data;
    }
189770
public function get_results() {
        $query = $this->build_query();
        $query = $this->_solrclient->createSelect($query);

        if (isset($this->_query_modifiers['limit'])) {
            $query->setRows($this->_query_modifiers['limit']);
        }

        if (isset($this->_query_modifiers['offset'])) {
            $query->setStart($this->_query_modifiers['offset']);
        }

        if (isset($this->_query_modifiers['fields'])) {
            $query->setFields($this->_query_modifiers['fields']);
        }

        if (isset($this->_query_modifiers['sort'])) {
            foreach ($this->_query_modifiers['sort'] as $k => $dir) {
                $dir = $dir == 'ASC' ? $query::SORT_ASC : $query::SORT_DESC;
                $query->addSort($k, $dir);
            }
        }

        $results = array();

        $resultsset = $this->_solrclient->select($query);
        foreach ($resultset as $document) {
            $class = $document->collection = 'cartoons' ? 'CartoonsResult' : 'CollectionsResult';
            $results[] = new $class($document);
        }

        return $results;
    }