tableName = $tableName; $this->draw = (int)$draw; $this->start = (int)$start; $this->length = (int)$length; $this->columns = (array)$columns; $this->search = (array)$search; $this->order = (array)$order; $this->filter = (array)$filter; $this->export = (array)$export; } /** * @param Request $request * * @return self */ public static function fromRequest(Request $request) { $params = $request->getMethod() === 'GET' ? $request->get : $request->post; $tableName = $params->getAlphaNumWithDashes('tablename', null); $draw = $params->getInt('draw', 1); $start = $params->getInt('start', 0); $length = $params->getInt('length', 10); $columns = (array)$params->get('columns', []); $search = (array)$params->get('search', []); $order = (array)$params->get('order', []); $filter = (array)$params->get('filter', []); $export = (array)$params->get('export', []); return new self($tableName, $draw, $start, $length, $columns, $search, $order, $filter, $export); } /** * @return string|null */ public function getTableName() { return $this->tableName; } /** * @return int */ public function getDraw() { return $this->draw; } /** * @return int */ public function getStart() { return $this->start; } /** * @return int */ public function getLength() { return $this->length; } /** * @return array */ public function getSearchValues() { return $this->search; } /** * @return array */ public function getOrderValues() { return $this->order; } /** * @return array */ public function getColumnsValues() { return $this->columns; } /** * @return array */ public function getFilterValues() { return $this->filter; } /** * @return array */ public function getExportValues() { return $this->export; } }