Fetch all the data from this Data Source.

If offset and / or limit are set, only those records will be returned.

@return array The records
@throws \Exception
@throws InvalidArgumentException
6414
public function fetch()
    {
        static $currentLine = 0;
        $dataResult = array();

        if (isset($this->options['skipHeader']) && $this->options['skipHeader'] === true) {
            $skipLines = 1;
        } elseif (isset($this->options['skipHeader']) && \is_numeric($this->options['skipHeader'])) {
            $skipLines = (int)$this->options['skipHeader'];
        } else {
            $skipLines = 0;
        }
        if (($handle = fopen($this->csvFilePath, 'r')) !== false) {
            while (($data = fgetcsv($handle, 65534, $this->csvDelimiter, $this->csvEnclosure)) !== false) {
                // skip header (maybe is better to set the first offset position instead)
                if ($currentLine < $skipLines) {
                    $currentLine++;
                    continue;
                }
                if ($currentLine >= $this->offset && $currentLine < ($this->offset + $this->limit)) {
                    if (isset($data[0]) && $data[0] !== '') {
                        $this->preProcessRecordData($data);
                        $dataResult[] = $data;
                    }
                }
                $currentLine++;
            }
            fclose($handle);
        }
        $this->logger->log(sprintf('%s: read %s lines and found %s records.', $this->csvFilePath, $currentLine, count($dataResult)), LOG_DEBUG);
        return $dataResult;
    }
1279043
public function get()
    {
        $list      = [];
        $i         = 0;
        $realLimit = $this->offset && $this->limit
            ? $this->offset + $this->limit
            : $this->limit;

        foreach ($this->getData() as &$rs) {
            if ($this->offset && $this->offset > $i) {
                $i++;
                continue;
            }

            if ($realLimit && $realLimit == $i) {
                break;
            }

            if (!$this->where) {
                $list[] = $this->convertItem($rs);
                $i++;
                continue;
            }

            if ($this->matchWhere($rs)) {
                $list[] = $this->convertItem($rs);
                $i++;
            }
        }

        return $list;
    }
648371
public function fetch()
    {
        
        if ((null !== $this->statement) && $this->statement->fetch()) {
            $row = [];
            foreach ($this->stmt_results as $dbColumnName => $dbColumnValue) {
                $row[$this->stmt_cols[$dbColumnName]] = $dbColumnValue;
            }
            return $row;
        } elseif ($this->result instanceof \mysqli_result) {
            return mysqli_fetch_array($this->result, MYSQLI_ASSOC);
        } else {
            return null;
            
            if (!isset($this->result)) {
                throw new Exception('The database result resource is not currently set.');
            }
        }
    }
308931
public function get(): array
    {
        try {
            $query = $this->apply($this->database->getTablePrefixer());
            $compiled = $this->database->getGrammar()->compileSelect($query);
            return $this->database->select($compiled->getSQL(), $compiled->getBindings());
        } catch (\Throwable $exception) {
            return $this->handleException($exception);
        }
    }
604009
public function fetchAll()
    {
        $result = $this->statement->fetchAll(\PDO::FETCH_ASSOC);
        $rows = array();

        if ($this->model !== null) {
            foreach ($result as $row) {
                $model = $this->model;
                $rows[] = new $model($row, false);
            }
        } else {
            foreach ($result as $row) {
                $rows[] = $row;
            }
        }

        return $rows;
    }
1075189
public function fetchAll($limit = null, $offset = null){
		$limit = $limit === null ? -1 : (int) $limit;
		if($offset !== null)
			$this->seek((int) $offset);

		$row = $this->fetch();
		if(!$row)
			return array();

		$rows = array();
		do{
			if($limit === 0)
				break;
			$rows[] = $row;
			$limit--;
		} while($row = $this->fetch());

		return $rows;
	}
679405
public function getData() {
        if ($this->toSort && !empty($this->getOrder())) {
            $this->sortData();
        }

        if ($this->getLimit()) {
            return array_slice($this->data, $this->getOffset(), $this->getLimit());
        } else {
            return $this->data;
        }
    }
178092
public function getList()
    {
        /** @var Select|QueryObjectInterface $query */
        $query = $this->getRepository()->find();
        $this->getFilters()->apply($query);
        $this->getPagination()->setTotal($query->count());
        $query->order($this->getOrder());
        $query->limit(
            $this->getPagination()->rowsPerPage,
            $this->getPagination()->offset
        );
        return $query->all();
    }
1186312
public function getArray()
    {
        $contents = include $this->context;

        if (gettype($contents) != 'array') {
            throw new InvalidFileException($this->context . ' does not return a valid array');
        }

        return $contents;
    }
1328512
public function fetch()
	{
		if(count($this->select->getColumns()) === 0)
		{
			/** @var Column $column */
			$column = $this->factory->references('Column', '*');
			$this->select->column($column);
		}
		$query    = $this->factory->builder($this->select)->process();
		$queryObj = $this->pdo->query($query);
		if($queryObj)
		{
			return $queryObj->fetchAll(\PDO::FETCH_ASSOC);
		}

		return array();
	}
97289
public function toArray(): array
    {
        $type = $this->getType();

        if (empty($type)) {
            throw new InvalidException('Type has to be set');
        }

        return [$type->getName() => $this->_mapping];
    }
315891
public function all()
    {
        $this->prepFetch();

        $result = $this->oosql_stmt->fetchAll();

        $collection = new collection();

        $collection->addBulk($result);

        $collection->obj_name = $this->oosql_class;

        self::$oosql_result = clone $collection;

        return $collection;
    }
209291
public function fetchAll()
    {
        if ($this->usePaginator === true) {
            return $this->initPaginator($this->tableGateway->getSql()->select());
        }
        $this->result = $this->tableGateway->select();

        return $this->result;
    }
1092804
public function fetch(): array
    {
        $sql = $this->builder->buildSql();
        $this->builder = new QueryBuilder($this->pdo);
        return $this->fetchBySql($sql);
    }
219301
public function all(): array
    {
        $this->execute();
        
        $data = $this->stmt->fetchAll(\PDO::FETCH_CLASS, '\Core\Data\DataObject');
        
        if (! empty($data)) {
            $data = $this->executeCallbackAndSchemeHandler($data);
        }
        
        return $data;
    }
821959
public function all()
    {
        if ($this->exception !== null) {
            throw $this->exception;
        }

        return $this->fetch(true, $this->fetchAssoc);
    }
61470
public function getAll()
    {
        $result = [];

        foreach ($this->getData() as $key => $value) {
            $result[$key] = $this->get($key);
        }

        return $result;
    }