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 | * @return array |
||
88 | */ |
||
89 | 11 | protected function getFieldSets(): array |
|
93 | |||
94 | /** |
||
95 | * @param string $type |
||
96 | * |
||
97 | * @return bool |
||
98 | */ |
||
99 | 57 | protected function hasFilter(string $type): bool |
|
103 | |||
104 | /** |
||
105 | * @param string $type |
||
106 | * |
||
107 | * @return array |
||
108 | */ |
||
109 | 11 | protected function getAllowedFields(string $type): array |
|
115 | |||
116 | /** |
||
117 | * @param string $type |
||
118 | * @param iterable $fields |
||
119 | * |
||
120 | * @return iterable |
||
121 | */ |
||
122 | 56 | protected function filterFields(string $type, iterable $fields): iterable |
|
137 | } |
||
138 |