OpenSkill\Datatable\Queries\Parser\Datatable19QueryParser::parse PHP Метод

parse() публичный Метод

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
Результат 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();
    }

Usage Example

Пример #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);
 }
All Usage Examples Of OpenSkill\Datatable\Queries\Parser\Datatable19QueryParser::parse