public parse ( |
||
$request | The current request that should be investigated | |
$columnConfiguration | array | The configuration of the columns |
리턴 | OpenSkill\Datatable\Queries\QueryConfiguration | the configuration the provider can use to prepare the data |
public function parse(Request $request, array $columnConfiguration)
{
$query = $request->query;
$builder = QueryConfigurationBuilder::create();
$this->getDrawCall($query, $builder);
$this->getStart($query, $builder);
$this->getLength($query, $builder);
$this->getSearch($query, $builder);
$this->determineSortableColumns($query, $builder, $columnConfiguration);
$this->getRegex($query, $builder);
$this->getSearchColumns($query, $builder, $columnConfiguration);
return $builder->build();
}
/** * Method that should parse the request and return a DTQueryConfiguration * * @param ColumnConfiguration[] $columnConfiguration The configuration of the columns * * @return QueryConfiguration the configuration the provider can use to prepare the data */ public function parseRequest(array $columnConfiguration) { $request = $this->requestStack->getCurrentRequest(); if (is_null($request)) { throw new \InvalidArgumentException("Can not parse a request that is null"); } return $this->queryParser->parse($request, $columnConfiguration); }