@@ -59,7 +59,6 @@ |
||
| 59 | 59 | * Returns JSON response with search response data. |
| 60 | 60 | * |
| 61 | 61 | * @param Request $request Request. |
| 62 | - * @param string $name Filter manager name. |
|
| 63 | 62 | * |
| 64 | 63 | * @return JsonResponse |
| 65 | 64 | */ |
@@ -35,6 +35,7 @@ |
||
| 35 | 35 | * so do not forget to call parent if you extend it. |
| 36 | 36 | * |
| 37 | 37 | * @param array $options |
| 38 | + * @return void |
|
| 38 | 39 | */ |
| 39 | 40 | public function setOptions(array $options); |
| 40 | 41 | |
@@ -15,7 +15,6 @@ |
||
| 15 | 15 | use ONGR\ElasticsearchBundle\Result\DocumentIterator; |
| 16 | 16 | use ONGR\FilterManagerBundle\Filter\Helper\DocumentFieldAwareInterface; |
| 17 | 17 | use ONGR\FilterManagerBundle\Filter\Helper\RequestFieldAwareInterface; |
| 18 | -use ONGR\FilterManagerBundle\Filter\Helper\ViewDataFactoryInterface; |
|
| 19 | 18 | use ONGR\FilterManagerBundle\Filter\Relation\RelationAwareInterface; |
| 20 | 19 | use ONGR\FilterManagerBundle\Search\SearchRequest; |
| 21 | 20 | use Symfony\Component\HttpFoundation\Request; |
@@ -19,7 +19,6 @@ |
||
| 19 | 19 | use ONGR\FilterManagerBundle\Filter\ViewData\ChoicesAwareViewData; |
| 20 | 20 | use ONGR\FilterManagerBundle\Filter\ViewData; |
| 21 | 21 | use ONGR\FilterManagerBundle\Filter\Widget\AbstractFilter; |
| 22 | -use ONGR\FilterManagerBundle\Filter\Widget\AbstractSingleRequestValueFilter; |
|
| 23 | 22 | use ONGR\FilterManagerBundle\Search\SearchRequest; |
| 24 | 23 | |
| 25 | 24 | /** |
@@ -59,14 +59,14 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | if ($relatedSearch->getPostFilters()) { |
| 62 | - $filterAggregation = new FilterAggregation($name . '-filter'); |
|
| 62 | + $filterAggregation = new FilterAggregation($name.'-filter'); |
|
| 63 | 63 | $filterAggregation->setFilter($relatedSearch->getPostFilters()); |
| 64 | 64 | $filterAggregation->addAggregation($aggregation); |
| 65 | 65 | $search->addAggregation($filterAggregation); |
| 66 | 66 | |
| 67 | 67 | if ($this->getOption('show_zero_choices')) { |
| 68 | 68 | $unfilteredAggregation = clone $aggregation; |
| 69 | - $unfilteredAggregation->setName($name . '-unfiltered'); |
|
| 69 | + $unfilteredAggregation->setName($name.'-unfiltered'); |
|
| 70 | 70 | $search->addAggregation($unfilteredAggregation); |
| 71 | 71 | } |
| 72 | 72 | } else { |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $unsortedChoices = []; |
| 93 | 93 | $zeroValueChoices = []; |
| 94 | 94 | |
| 95 | - if ($this->getOption('show_zero_choices') && $agg = $result->getAggregation($data->getName() . '-unfiltered')) { |
|
| 95 | + if ($this->getOption('show_zero_choices') && $agg = $result->getAggregation($data->getName().'-unfiltered')) { |
|
| 96 | 96 | foreach ($agg as $bucket) { |
| 97 | 97 | $zeroValueChoices[$bucket['key']] = $bucket['doc_count']; |
| 98 | 98 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | ->arrayNode('filters') |
| 76 | 76 | ->validate() |
| 77 | 77 | ->ifTrue( |
| 78 | - function ($v) { |
|
| 78 | + function($v) { |
|
| 79 | 79 | $v = array_filter($v); |
| 80 | 80 | |
| 81 | 81 | return empty($v); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $filter |
| 122 | 122 | ->validate() |
| 123 | 123 | ->ifTrue( |
| 124 | - function ($v) { |
|
| 124 | + function($v) { |
|
| 125 | 125 | return empty($v['include']) && empty($v['exclude']); |
| 126 | 126 | } |
| 127 | 127 | ) |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | ->end() |
| 130 | 130 | ->validate() |
| 131 | 131 | ->ifTrue( |
| 132 | - function ($v) { |
|
| 132 | + function($v) { |
|
| 133 | 133 | return !empty($v['include']) && !empty($v['exclude']); |
| 134 | 134 | } |
| 135 | 135 | ) |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | ->beforeNormalization() |
| 141 | 141 | ->ifString() |
| 142 | 142 | ->then( |
| 143 | - function ($v) { |
|
| 143 | + function($v) { |
|
| 144 | 144 | return [$v]; |
| 145 | 145 | } |
| 146 | 146 | )->end() |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | ->beforeNormalization() |
| 151 | 151 | ->ifString() |
| 152 | 152 | ->then( |
| 153 | - function ($v) { |
|
| 153 | + function($v) { |
|
| 154 | 154 | return [$v]; |
| 155 | 155 | } |
| 156 | 156 | ) |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | $configuration = new Configuration(); |
| 37 | 37 | $config = $this->processConfiguration($configuration, $configs); |
| 38 | 38 | |
| 39 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
| 39 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 40 | 40 | $loader->load('services.yml'); |
| 41 | 41 | |
| 42 | 42 | $container->setParameter('ongr_filter_manager.filters', $config['filters']); |