1 | <?php |
||
16 | class InputState implements StateInterface |
||
17 | { |
||
18 | const FILTERS = 'filters'; |
||
19 | const FILTER_VALUES = 'values'; |
||
20 | const SORTER = 'sortBy'; |
||
21 | const DIRECTION = 'order'; |
||
22 | const PAGE = 'page'; |
||
23 | const LIMIT = 'limit'; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $namespace = ''; |
||
29 | |||
30 | /** |
||
31 | * @var InputInterface |
||
32 | */ |
||
33 | private $input = null; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $source = 'query'; |
||
39 | |||
40 | /** |
||
41 | * @param InputInterface $input |
||
42 | * @param string $source |
||
43 | * @param string $namespace |
||
44 | */ |
||
45 | public function __construct(InputInterface $input, $source = 'query', $namespace = '') |
||
50 | |||
51 | /** |
||
52 | * @param string $source |
||
53 | * @return InputState |
||
54 | */ |
||
55 | public function withSource($source) |
||
62 | |||
63 | /** |
||
64 | * @return string |
||
65 | */ |
||
66 | public function getSource() |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function isActive() |
||
84 | |||
85 | /** |
||
86 | * {@inheritdoc} |
||
87 | */ |
||
88 | public function withNamespace($namespace) |
||
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | public function getNamespace() |
||
103 | |||
104 | /** |
||
105 | * {@inheritdoc} |
||
106 | */ |
||
107 | public function activeFilters() |
||
117 | |||
118 | /** |
||
119 | * {@inheritdoc} |
||
120 | */ |
||
121 | public function getValue($filter, $default = null) |
||
134 | |||
135 | /** |
||
136 | * {@inheritdoc} |
||
137 | */ |
||
138 | public function activeSorter() |
||
147 | |||
148 | /** |
||
149 | * {@inheritdoc} |
||
150 | */ |
||
151 | public function sortDirection() |
||
161 | |||
162 | /** |
||
163 | * {@inheritdoc} |
||
164 | */ |
||
165 | public function getPage() |
||
169 | |||
170 | /** |
||
171 | * {@inheritdoc} |
||
172 | */ |
||
173 | public function getLimit() |
||
177 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.