1 | <?php |
||
18 | abstract class Version |
||
19 | { |
||
20 | /** |
||
21 | * @var RequestStack |
||
22 | */ |
||
23 | protected $requestStack; |
||
24 | |||
25 | /** |
||
26 | * Version constructor. |
||
27 | */ |
||
28 | public function __construct(RequestStack $requestStack) |
||
32 | |||
33 | /** |
||
34 | * Method to determine if this parser can handle the query parameters. If so then the parser should return true |
||
35 | * and be able to return a DTQueryConfiguration |
||
36 | * |
||
37 | * @return bool true if the parser is able to parse the query parameters and to return a DTQueryConfiguration |
||
38 | */ |
||
39 | abstract public function canParseRequest(); |
||
40 | |||
41 | /** |
||
42 | * Method that should parse the request and return a DTQueryConfiguration |
||
43 | * |
||
44 | * @param ColumnConfiguration[] $columnConfiguration The configuration of the columns |
||
45 | * @return QueryConfiguration the configuration the provider can use to prepare the data |
||
46 | */ |
||
47 | abstract public function parseRequest(array $columnConfiguration); |
||
48 | |||
49 | |||
50 | /** |
||
51 | * Is responsible to take the generated data and prepare a response for it. |
||
52 | * @param ResponseData $data The processed data. |
||
53 | * @param QueryConfiguration $queryConfiguration the query configuration for the current request. |
||
54 | * @param ColumnConfiguration[] $columnConfigurations the column configurations for the current data table. |
||
55 | * @return JsonResponse the response that should be returned to the client. |
||
56 | */ |
||
57 | abstract public function createResponse( |
||
62 | |||
63 | /** |
||
64 | * @return string The name of the view that this version should use fot the table. |
||
65 | */ |
||
66 | abstract public function tableView(); |
||
67 | |||
68 | /** |
||
69 | * @return string The name of the view that this version should use for the script. |
||
70 | */ |
||
71 | abstract public function scriptView(); |
||
72 | } |