1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the Sonata Project package. |
7
|
|
|
* |
8
|
|
|
* (c) Thomas Rabaix <[email protected]> |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
11
|
|
|
* file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Sonata\AdminBundle\Datagrid; |
15
|
|
|
|
16
|
|
|
use Sonata\AdminBundle\Admin\FieldDescriptionCollection; |
17
|
|
|
use Sonata\AdminBundle\Admin\FieldDescriptionInterface; |
18
|
|
|
use Sonata\AdminBundle\Filter\FilterInterface; |
19
|
|
|
use Symfony\Component\Form\FormInterface; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @author Thomas Rabaix <[email protected]> |
23
|
|
|
*/ |
24
|
|
|
interface DatagridInterface |
25
|
|
|
{ |
26
|
|
|
public function getPager(): PagerInterface; |
27
|
|
|
|
28
|
|
|
public function getQuery(): ProxyQueryInterface; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @return object[] |
32
|
|
|
*/ |
33
|
|
|
public function getResults(): array; |
34
|
|
|
|
35
|
|
|
public function buildPager(): void; |
36
|
|
|
|
37
|
|
|
public function addFilter(FilterInterface $filter): void; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @return array<string, FilterInterface> |
|
|
|
|
41
|
|
|
*/ |
42
|
|
|
public function getFilters(): array; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* Reorder filters. |
46
|
|
|
* |
47
|
|
|
* @param string[] $keys |
48
|
|
|
*/ |
49
|
|
|
public function reorderFilters(array $keys): void; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @return array<string, mixed> |
|
|
|
|
53
|
|
|
*/ |
54
|
|
|
public function getValues(): array; |
55
|
|
|
|
56
|
|
|
public function getColumns(): FieldDescriptionCollection; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @param mixed $value |
60
|
|
|
*/ |
61
|
|
|
public function setValue(string $name, ?string $operator, $value): void; |
62
|
|
|
|
63
|
|
|
public function getForm(): FormInterface; |
64
|
|
|
|
65
|
|
|
public function getFilter(string $name): FilterInterface; |
66
|
|
|
|
67
|
|
|
public function hasFilter(string $name): bool; |
68
|
|
|
|
69
|
|
|
public function removeFilter(string $name): void; |
70
|
|
|
|
71
|
|
|
public function hasActiveFilters(): bool; |
72
|
|
|
|
73
|
|
|
public function hasDisplayableFilters(): bool; |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* TODO: avoid returning an array with one element and return its contents instead. |
77
|
|
|
* |
78
|
|
|
* @return array{filter: array<string, mixed>} |
|
|
|
|
79
|
|
|
*/ |
80
|
|
|
public function getSortParameters(FieldDescriptionInterface $fieldDescription): array; |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* TODO: avoid returning an array with one element and return its contents instead. |
84
|
|
|
* |
85
|
|
|
* @return array{filter: array<string, mixed>} |
|
|
|
|
86
|
|
|
*/ |
87
|
|
|
public function getPaginationParameters(int $page): array; |
88
|
|
|
} |
89
|
|
|
|
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.