/** * Return all the rows from the crud table when the crud * is set to use ajax requests, if a override query * has been set, then it will return the result of it filtered, * ordered and paginated * * @return array */ public function getDatatableAjaxRows(DatatableAjaxRequest $ajaxRequest) { // If a custom list query was not defined if (!$this->hasCustomDatatableQuery()) { $result = Queries::getFilteredAjaxTableRows($this->getTable(), $this->getColumns(), $ajaxRequest->getPagitionStart(), $ajaxRequest->getPaginationLength(), $ajaxRequest->getFilters($this->getResolvedAmbiguousColumns()), $ajaxRequest->getOrder()); // If it was } else { $result = Queries::getFilteredQueryListRows($this->getCustomDatatableQuery(), $ajaxRequest->getPagitionStart(), $ajaxRequest->getPaginationLength(), $ajaxRequest->getFilters($this->getResolvedAmbiguousColumns()), $ajaxRequest->getOrder()); } return new DatatableAjaxResponse(DatatableBodyOptions::fill($result['rows'], $this->getCustomDatatableColumns(), $this->getTablePrimaryKeys()), $this->getDatatableActions(), $result['count_filtered'], $result['count_total'], $ajaxRequest->getDraw()); }