parse() public method

Method that should parse the request and return a DTQueryConfiguration
public parse ( Request $request, array $columnConfiguration ) : OpenSkill\Datatable\Queries\QueryConfiguration
$request Symfony\Component\HttpFoundation\Request The current request that should be investigated
$columnConfiguration array The configuration of the columns
return OpenSkill\Datatable\Queries\QueryConfiguration the configuration the provider can use to prepare the data
Esempio n. 1
0
 /**
  * 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);
 }
 /**
  * Will test that an empty search will not trigger a search.
  */
 public function testEmptySearch()
 {
     $this->request = new Request(['sEcho' => 13, 'iDisplayStart' => 11, 'iDisplayLength' => 103, 'sSearch' => '', 'sSearch_0' => '']);
     $this->parser = new Datatable19QueryParser($this->request);
     $column = ColumnConfigurationBuilder::create()->name("id")->build();
     $conf = $this->parser->parse($this->request, [$column]);
     // assert column order
     $this->assertFalse($conf->isGlobalSearch());
     $this->assertCount(0, $conf->searchColumns());
     $this->assertFalse($conf->isColumnSearch());
 }