Grido\Grid::getData PHP Method

getData() public method

Returns fetched data.
public getData ( boolean $applyPaging = TRUE, boolean $useCache = TRUE, boolean $fetch = TRUE ) : array | Grido\DataSources\IDataSource | Selection
$applyPaging boolean
$useCache boolean
$fetch boolean
return array | Grido\DataSources\IDataSource | Nette\Database\Table\Selection
    public function getData($applyPaging = TRUE, $useCache = TRUE, $fetch = TRUE)
    {
        if ($this->getModel() === NULL) {
            throw new Exception('Model cannot be empty, please use method $grid->setModel().');
        }
        $data = $this->data;
        if ($data === NULL || $useCache === FALSE) {
            $this->applyFiltering();
            $this->applySorting();
            if ($applyPaging) {
                $this->applyPaging();
            }
            if ($fetch === FALSE) {
                return $this->getModel();
            }
            $data = $this->getModel()->getData();
            if ($useCache === TRUE) {
                $this->data = $data;
            }
            if ($applyPaging && !empty($data) && !in_array($this->page, range(1, $this->getPaginator()->pageCount))) {
                $this->__triggerUserNotice("Page is out of range.");
                $this->page = 1;
            }
            if (!empty($this->onFetchData)) {
                $this->onFetchData($this);
            }
        }
        return $data;
    }