container = $container; } /** * @return DataTableRequestHandler */ public function createDataTableRequestHandler() { return new DataTableRequestHandler($this->createDataTableService(), $this->createDataTableRequest()); } /** * @return DataTableService */ public function createDataTableService() { return new DataTableService( $this->createDataTableBuilder(), $this->createDataTableRenderer(), $this->createDataTableFetcher() ); } /** * @return DataTableBuilder */ private function createDataTableBuilder() { return new DataTableBuilder($this->container->get('Database')); } /** * @return DataTableRenderer */ private function createDataTableRenderer() { return new DataTableRenderer(); } /** * @return DataTableFetcher */ private function createDataTableFetcher() { return new DataTableFetcher($this->container->get('Database'), $this->createDataTableRequest()); } /** * @return DataTableRequest */ private function createDataTableRequest() { return DataTableRequest::fromRequest($this->container->get('Request')); } }