-
Notifications
You must be signed in to change notification settings - Fork 11
/
DataTableInterface.php
executable file
·218 lines (153 loc) · 6.9 KB
/
DataTableInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<?php
declare(strict_types=1);
namespace Kreyu\Bundle\DataTableBundle;
use Kreyu\Bundle\DataTableBundle\Action\ActionInterface;
use Kreyu\Bundle\DataTableBundle\Action\Type\ActionType;
use Kreyu\Bundle\DataTableBundle\Action\Type\ActionTypeInterface;
use Kreyu\Bundle\DataTableBundle\Column\ColumnInterface;
use Kreyu\Bundle\DataTableBundle\Column\Type\ColumnType;
use Kreyu\Bundle\DataTableBundle\Column\Type\ColumnTypeInterface;
use Kreyu\Bundle\DataTableBundle\Exception\OutOfBoundsException;
use Kreyu\Bundle\DataTableBundle\Exporter\ExportData;
use Kreyu\Bundle\DataTableBundle\Exporter\ExporterInterface;
use Kreyu\Bundle\DataTableBundle\Exporter\ExportFile;
use Kreyu\Bundle\DataTableBundle\Exporter\Type\ExporterType;
use Kreyu\Bundle\DataTableBundle\Exporter\Type\ExporterTypeInterface;
use Kreyu\Bundle\DataTableBundle\Filter\FilterInterface;
use Kreyu\Bundle\DataTableBundle\Filter\FiltrationData;
use Kreyu\Bundle\DataTableBundle\Filter\Type\FilterType;
use Kreyu\Bundle\DataTableBundle\Filter\Type\FilterTypeInterface;
use Kreyu\Bundle\DataTableBundle\Pagination\PaginationData;
use Kreyu\Bundle\DataTableBundle\Pagination\PaginationInterface;
use Kreyu\Bundle\DataTableBundle\Personalization\PersonalizationData;
use Kreyu\Bundle\DataTableBundle\Query\ProxyQueryInterface;
use Kreyu\Bundle\DataTableBundle\Sorting\SortingData;
use Symfony\Component\Form\FormBuilderInterface;
interface DataTableInterface
{
public function initialize(): void;
public function getName(): string;
public function getQuery(): ProxyQueryInterface;
public function getConfig(): DataTableConfigInterface;
/**
* @return array<string, ColumnInterface>
*/
public function getColumns(): array;
/**
* @return array<string, ColumnInterface>
*/
public function getVisibleColumns(): array;
/**
* @return array<string, ColumnInterface>
*/
public function getHiddenColumns(): array;
/**
* @return array<string, ColumnInterface>
*/
public function getExportableColumns(): array;
/**
* @throws OutOfBoundsException if column of given name does not exist
*/
public function getColumn(string $name): ColumnInterface;
public function hasColumn(string $name): bool;
/**
* @param class-string<ColumnTypeInterface> $type
*/
public function addColumn(ColumnInterface|string $column, string $type = ColumnType::class, array $options = []): static;
public function removeColumn(string $name): static;
/**
* @return array<string, FilterInterface>
*/
public function getFilters(): array;
/**
* @throws OutOfBoundsException if filter of given name does not exist
*/
public function getFilter(string $name): FilterInterface;
public function hasFilter(string $name): bool;
/**
* @param class-string<FilterTypeInterface> $type
*/
public function addFilter(FilterInterface|string $filter, string $type = FilterType::class, array $options = []): static;
public function removeFilter(string $name): static;
/**
* @return array<string, ActionInterface>
*/
public function getActions(): array;
/**
* @throws OutOfBoundsException if action of given name does not exist
*/
public function getAction(string $name): ActionInterface;
public function hasAction(string $name): bool;
/**
* @param class-string<ActionTypeInterface> $type
*/
public function addAction(ActionInterface|string $action, string $type = ActionType::class, array $options = []): static;
public function removeAction(string $name): static;
/**
* @return array<string, ActionInterface>
*/
public function getBatchActions(): array;
/**
* @throws OutOfBoundsException if batch action of given name does not exist
*/
public function getBatchAction(string $name): ActionInterface;
public function hasBatchAction(string $name): bool;
/**
* @param class-string<ActionTypeInterface> $type
*/
public function addBatchAction(ActionInterface|string $action, string $type = ActionType::class, array $options = []): static;
public function removeBatchAction(string $name): static;
/**
* @return array<string, ActionInterface>
*/
public function getRowActions(): array;
/**
* @throws OutOfBoundsException if row action of given name does not exist
*/
public function getRowAction(string $name): ActionInterface;
public function hasRowAction(string $name): bool;
/**
* @param class-string<ActionTypeInterface> $type
*/
public function addRowAction(ActionInterface|string $action, string $type = ActionType::class, array $options = []): static;
public function removeRowAction(string $name): static;
/**
* @return array<string, ExporterInterface>
*/
public function getExporters(): array;
/**
* @throws OutOfBoundsException if exporter of given name does not exist
*/
public function getExporter(string $name): ExporterInterface;
public function hasExporter(string $name): bool;
/**
* @param class-string<ExporterTypeInterface> $type
*/
public function addExporter(ExporterInterface|string $exporter, string $type = ExporterType::class, array $options = []): static;
public function removeExporter(string $name): static;
public function sort(SortingData $data): void;
public function filter(FiltrationData $data): void;
public function paginate(PaginationData $data): void;
public function personalize(PersonalizationData $data): void;
public function export(?ExportData $data = null): ExportFile;
public function getItems(): iterable;
public function getPagination(): PaginationInterface;
public function getSortingData(): ?SortingData;
public function setSortingData(?SortingData $sortingData): static;
public function setPaginationData(?PaginationData $paginationData): static;
public function getPaginationData(): ?PaginationData;
public function setFiltrationData(?FiltrationData $filtrationData): static;
public function getFiltrationData(): ?FiltrationData;
public function setPersonalizationData(?PersonalizationData $personalizationData): static;
public function getPersonalizationData(): ?PersonalizationData;
public function setExportData(?ExportData $exportData): static;
public function getExportData(): ?ExportData;
public function createFiltrationFormBuilder(?DataTableView $view = null): FormBuilderInterface;
public function createPersonalizationFormBuilder(?DataTableView $view = null): FormBuilderInterface;
public function createExportFormBuilder(?DataTableView $view = null): FormBuilderInterface;
public function isExporting(): bool;
public function hasActiveFilters(): bool;
public function handleRequest(mixed $request): void;
public function createView(): DataTableView;
public function createExportView(): DataTableView;
}