@@ 19-47 (lines=29) @@ | ||
16 | /** |
|
17 | * Factory for pager filter. |
|
18 | */ |
|
19 | class PagerFilterFactory extends AbstractFilterFactory |
|
20 | { |
|
21 | /** |
|
22 | * {@inheritdoc} |
|
23 | */ |
|
24 | protected function configure(Definition $definition, array $configuration) |
|
25 | { |
|
26 | parent::configure($definition, $configuration); |
|
27 | ||
28 | $definition->addMethodCall('setCountPerPage', [$configuration['count_per_page']]); |
|
29 | $definition->addMethodCall('setMaxPages', [$configuration['max_pages']]); |
|
30 | } |
|
31 | ||
32 | /** |
|
33 | * {@inheritdoc} |
|
34 | */ |
|
35 | protected function getNamespace() |
|
36 | { |
|
37 | return 'ONGR\FilterManagerBundle\Filter\Widget\Pager\Pager'; |
|
38 | } |
|
39 | ||
40 | /** |
|
41 | * {@inheritdoc} |
|
42 | */ |
|
43 | public function getName() |
|
44 | { |
|
45 | return 'pager'; |
|
46 | } |
|
47 | } |
|
48 |
@@ 19-49 (lines=31) @@ | ||
16 | /** |
|
17 | * Factory for range filter. |
|
18 | */ |
|
19 | class RangeFilterFactory extends AbstractFilterFactory |
|
20 | { |
|
21 | /** |
|
22 | * {@inheritdoc} |
|
23 | */ |
|
24 | protected function configure(Definition $definition, array $configuration) |
|
25 | { |
|
26 | parent::configure($definition, $configuration); |
|
27 | ||
28 | $definition->addMethodCall('setField', [$configuration['field']]); |
|
29 | if (array_key_exists('inclusive', $configuration)) { |
|
30 | $definition->addMethodCall('setInclusive', [$configuration['inclusive']]); |
|
31 | } |
|
32 | } |
|
33 | ||
34 | /** |
|
35 | * {@inheritdoc} |
|
36 | */ |
|
37 | protected function getNamespace() |
|
38 | { |
|
39 | return 'ONGR\FilterManagerBundle\Filter\Widget\Range\Range'; |
|
40 | } |
|
41 | ||
42 | /** |
|
43 | * {@inheritdoc} |
|
44 | */ |
|
45 | public function getName() |
|
46 | { |
|
47 | return 'range'; |
|
48 | } |
|
49 | } |
|
50 |