File tree Expand file tree Collapse file tree 5 files changed +8
-38
lines changed
lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider Expand file tree Collapse file tree 5 files changed +8
-38
lines changed Original file line number Diff line number Diff line change 117
117
<argument name =" resourceModel" xsi : type =" string" >Magento\Cms\Model\ResourceModel\Block</argument >
118
118
</arguments >
119
119
</type >
120
- <virtualType name =" CmsGirdFilterPool" type =" Magento\Framework\View\Element\UiComponent\DataProvider\FilterPool" >
121
- <arguments >
122
- <argument name =" appliers" xsi : type =" array" >
123
- <item name =" regular" xsi : type =" object" >Magento\Framework\View\Element\UiComponent\DataProvider\RegularFilter</item >
124
- <item name =" fulltext" xsi : type =" object" >Magento\Framework\View\Element\UiComponent\DataProvider\FulltextFilter</item >
125
- </argument >
126
- </arguments >
127
- </virtualType >
128
120
<type name =" Magento\Framework\Model\Entity\RepositoryFactory" >
129
121
<arguments >
130
122
<argument name =" entities" xsi : type =" array" >
Original file line number Diff line number Diff line change 819
819
</argument >
820
820
</arguments >
821
821
</type >
822
- <type name =" Magento\Framework\View\Element\UiComponent\DataProvider\FilterPool" >
823
- <arguments >
824
- <argument name =" appliers" xsi : type =" array" >
825
- <item name =" regular" xsi : type =" object" >Magento\Framework\View\Element\UiComponent\DataProvider\RegularFilter</item >
826
- <item name =" fulltext" xsi : type =" object" >Magento\Framework\View\Element\UiComponent\DataProvider\FulltextFilter</item >
827
- </argument >
828
- </arguments >
829
- </type >
830
822
<type name =" Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory" >
831
823
<arguments >
832
824
<argument name =" collections" xsi : type =" array" >
Original file line number Diff line number Diff line change 45
45
<preference for =" Magento\Search\Model\AutocompleteInterface" type =" Magento\Search\Model\Autocomplete" />
46
46
<preference for =" Magento\Search\Model\Autocomplete\ItemInterface" type =" Magento\Search\Model\Autocomplete\Item" />
47
47
<preference for =" Magento\Framework\Search\SearchEngineInterface" type =" Magento\Search\Model\SearchEngine" />
48
- <type name =" Magento\Framework\View\Element\UiComponent\DataProvider\FilterPool" >
49
- <arguments >
50
- <argument name =" appliers" xsi : type =" array" >
51
- <item name =" regular" xsi : type =" object" >Magento\Framework\View\Element\UiComponent\DataProvider\RegularFilter</item >
52
- <item name =" fulltext" xsi : type =" object" >Magento\Framework\View\Element\UiComponent\DataProvider\FulltextFilter</item >
53
- </argument >
54
- </arguments >
55
- </type >
56
48
<!-- @api -->
57
49
<virtualType name =" Magento\Search\Model\ResourceModel\Synonyms\Grid\Collection" type =" Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult" >
58
50
<arguments >
Original file line number Diff line number Diff line change 194
194
<argument name =" uiReader" xsi : type =" object" >uiDefinitionReader</argument >
195
195
</arguments >
196
196
</type >
197
- <type name =" Magento\Ui\Component\Filter \FilterPool" >
197
+ <type name =" Magento\Framework\View\Element\UiComponent\DataProvider \FilterPool" >
198
198
<arguments >
199
- <argument name =" filters" xsi : type =" array" >
200
- <item name =" filter_input" xsi : type =" string" >Magento\Ui\Component\Filter\Type\Input</item >
201
- <item name =" filter_select" xsi : type =" string" >Magento\Ui\Component\Filter\Type\Select</item >
202
- <item name =" filter_range" xsi : type =" string" >Magento\Ui\Component\Filter\Type\Range</item >
203
- <item name =" filter_store" xsi : type =" string" >Magento\Ui\Component\Filter\Type\Store</item >
199
+ <argument name =" appliers" xsi : type =" array" >
200
+ <item name =" regular" xsi : type =" object" >Magento\Framework\View\Element\UiComponent\DataProvider\RegularFilter</item >
201
+ <item name =" fulltext" xsi : type =" object" >Magento\Framework\View\Element\UiComponent\DataProvider\FulltextFilter</item >
204
202
</argument >
205
203
</arguments >
206
204
</type >
Original file line number Diff line number Diff line change 3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+ declare (strict_types=1 );
6
7
7
8
namespace Magento \Framework \View \Element \UiComponent \DataProvider ;
8
9
17
18
class FilterPool
18
19
{
19
20
/**
20
- * @var array
21
+ * @var FilterApplierInterface[]
21
22
*/
22
23
protected $ appliers ;
23
24
24
25
/**
25
- * @param array $appliers
26
+ * @param FilterApplierInterface[] $appliers
26
27
*/
27
28
public function __construct (array $ appliers = [])
28
29
{
@@ -38,12 +39,7 @@ public function applyFilters(Collection $collection, SearchCriteriaInterface $cr
38
39
{
39
40
foreach ($ criteria ->getFilterGroups () as $ filterGroup ) {
40
41
foreach ($ filterGroup ->getFilters () as $ filter ) {
41
- /** @var $filterApplier FilterApplierInterface*/
42
- if (isset ($ this ->appliers [$ filter ->getConditionType ()])) {
43
- $ filterApplier = $ this ->appliers [$ filter ->getConditionType ()];
44
- } else {
45
- $ filterApplier = $ this ->appliers ['regular ' ];
46
- }
42
+ $ filterApplier = $ this ->appliers [$ filter ->getConditionType ()] ?? $ this ->appliers ['regular ' ];
47
43
$ filterApplier ->apply ($ collection , $ filter );
48
44
}
49
45
}
You can’t perform that action at this time.
0 commit comments