builder = $builder; $this->renderer = $renderer; $this->fetcher = $fetcher; } /** * @param DataTableBuildConfig $buildConfig * * @return bool */ public function canFetchData(DataTableBuildConfig $buildConfig) { return $this->fetcher->canFetchData($buildConfig); } /** * @param DataTableBuildConfig $buildConfig * * @return DataTableDataResult */ public function fetchData(DataTableBuildConfig $buildConfig) { $dataTable = $this->buildTable($buildConfig); return $this->fetcher->fetchData($dataTable); } /** * @param DataTableBuildConfig $buildConfig * * @return bool */ public function canExportData(DataTableBuildConfig $buildConfig) { return $this->fetcher->canExportData($buildConfig); } /** * @param DataTableBuildConfig $buildConfig * * @return string Path to temporary file */ public function exportData(DataTableBuildConfig $buildConfig) { $dataTable = $this->buildTable($buildConfig); return $this->fetcher->exportData($dataTable); } /** * @param DataTableBuildConfig $buildConfig * * @return DataTableHtmlResult */ public function renderHtml(DataTableBuildConfig $buildConfig) { $dataTable = $this->buildTable($buildConfig); return $this->renderer->createHtmlResult($dataTable); } /** * @param DataTableBuildConfig $buildConfig * * @return DataTableInterface */ private function buildTable(DataTableBuildConfig $buildConfig) { return $this->builder->buildTable($buildConfig); } }