1 | <?php declare(strict_types=1); |
||
28 | class FieldSetFilter implements FieldSetFilterInterface |
||
29 | { |
||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | private $fieldSets; |
||
34 | |||
35 | /** |
||
36 | * @param array|null $fieldSets |
||
37 | */ |
||
38 | 71 | public function __construct(array $fieldSets) |
|
56 | |||
57 | /** |
||
58 | * @inheritdoc |
||
59 | */ |
||
60 | 57 | public function getAttributes(ResourceInterface $resource): iterable |
|
64 | |||
65 | /** |
||
66 | * @inheritdoc |
||
67 | */ |
||
68 | 57 | public function getRelationships(ResourceInterface $resource): iterable |
|
72 | |||
73 | /** |
||
74 | * @inheritdoc |
||
75 | */ |
||
76 | 21 | public function shouldOutputRelationship(PositionInterface $position): bool |
|
85 | |||
86 | /** |
||
87 | * @param string $type |
||
88 | * |
||
89 | * @return bool |
||
90 | */ |
||
91 | 57 | protected function hasFilter(string $type): bool |
|
95 | |||
96 | /** |
||
97 | * @param string $type |
||
98 | * |
||
99 | * @return array |
||
100 | */ |
||
101 | 11 | protected function getAllowedFields(string $type): array |
|
107 | |||
108 | /** |
||
109 | * @param string $type |
||
110 | * @param iterable $fields |
||
111 | * |
||
112 | * @return iterable |
||
113 | */ |
||
114 | 56 | protected function filterFields(string $type, iterable $fields): iterable |
|
129 | } |
||
130 |