1 | <?php |
||
21 | class Datatable19Version extends Version |
||
22 | { |
||
23 | /** @var Datatable19QueryParser */ |
||
24 | private $queryParser; |
||
25 | |||
26 | /** |
||
27 | * Datatable19Version constructor. |
||
28 | * |
||
29 | * @param RequestStack $requestStack The current request |
||
30 | */ |
||
31 | public function __construct(RequestStack $requestStack) |
||
36 | |||
37 | /** |
||
38 | * Method to determine if this parser can handle the query parameters. If so then the parser should return true |
||
39 | * and be able to return a DTQueryConfiguration |
||
40 | * |
||
41 | * @return bool true if the parser is able to parse the query parameters and to return a DTQueryConfiguration |
||
42 | */ |
||
43 | public function canParseRequest() |
||
47 | |||
48 | /** |
||
49 | * Method that should parse the request and return a DTQueryConfiguration |
||
50 | * |
||
51 | * @param ColumnConfiguration[] $columnConfiguration The configuration of the columns |
||
52 | * |
||
53 | * @return QueryConfiguration the configuration the provider can use to prepare the data |
||
54 | */ |
||
55 | public function parseRequest(array $columnConfiguration) |
||
59 | |||
60 | /** |
||
61 | * Is responsible to take the generated data and prepare a response for it. |
||
62 | * @param ResponseData $data The processed data. |
||
63 | * @param QueryConfiguration $queryConfiguration the query configuration for the current request. |
||
64 | * @param ColumnConfiguration[] $columnConfigurations the column configurations for the current data table. |
||
65 | * @return JsonResponse the response that should be returned to the client. |
||
66 | */ |
||
67 | public function createResponse(ResponseData $data, QueryConfiguration $queryConfiguration, array $columnConfigurations) |
||
77 | |||
78 | /** |
||
79 | * @return string The name of the view that this version should use fot the table. |
||
80 | */ |
||
81 | public function getTableView() |
||
85 | |||
86 | /** |
||
87 | * @return string The name of the view that this version should use for the script. |
||
88 | */ |
||
89 | public function getScriptView() |
||
93 | } |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: