File tree Expand file tree Collapse file tree 4 files changed +3
-11
lines changed
app/code/Magento/CatalogGraphQl/Model/Resolver
Categories/DataProvider/Category/CollectionProcessor Expand file tree Collapse file tree 4 files changed +3
-11
lines changed Original file line number Diff line number Diff line change 8
8
namespace Magento \CatalogGraphQl \Model \Resolver \Categories \DataProvider \Category \CollectionProcessor ;
9
9
10
10
use Magento \Catalog \Api \CategoryRepositoryInterface ;
11
- use Magento \Catalog \Model \Category ;
12
11
use Magento \Catalog \Model \ResourceModel \Category \Collection ;
13
12
use Magento \CatalogGraphQl \Model \Resolver \Categories \DataProvider \Category \CollectionProcessorInterface ;
14
13
use Magento \Framework \Api \SearchCriteriaInterface ;
Original file line number Diff line number Diff line change 7
7
8
8
namespace Magento \CatalogGraphQl \Model \Resolver \Products \DataProvider ;
9
9
10
- use Exception ;
11
10
use GraphQL \Language \AST \FieldNode ;
12
11
use GraphQL \Language \AST \NodeKind ;
13
- use Iterator ;
14
12
use Magento \Catalog \Api \Data \CategoryInterface ;
15
- use Magento \Catalog \Model \Category ;
16
13
use Magento \Catalog \Model \ResourceModel \Category \Collection ;
17
14
use Magento \Catalog \Model \ResourceModel \Category \CollectionFactory ;
18
15
use Magento \CatalogGraphQl \Model \AttributesJoiner ;
19
16
use Magento \CatalogGraphQl \Model \Category \DepthCalculator ;
20
- use Magento \CatalogGraphQl \Model \Category \LevelCalculator ;
21
17
use Magento \CatalogGraphQl \Model \Resolver \Categories \DataProvider \Category \CollectionProcessorInterface ;
22
- use Magento \Framework \DB \Select ;
23
18
use Magento \Framework \DB \Sql \Expression ;
24
19
use Magento \Framework \Api \Search \SearchCriteria ;
25
20
use Magento \Framework \EntityManager \MetadataPool ;
26
21
use Magento \Framework \Exception \LocalizedException ;
27
22
use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
28
23
use Magento \GraphQl \Model \Query \ContextInterface ;
29
- use Magento \Store \Api \Data \StoreInterface ;
30
24
31
25
/**
32
26
* Category tree data provider
Original file line number Diff line number Diff line change 9
9
10
10
use Magento \Catalog \Model \Category ;
11
11
use Magento \CatalogGraphQl \Model \Category \Hydrator ;
12
- use Magento \Framework \App \ObjectManager ;
13
12
14
13
/**
15
14
* Tree node forgery for category tree wrapper.
Original file line number Diff line number Diff line change @@ -33,18 +33,18 @@ public function __construct(NodeWrapperFactory $nodeWrapperFactory)
33
33
* Build result tree from collection
34
34
*
35
35
* @param Collection $collection
36
- * @param array $topLevelCategories
36
+ * @param array $topLevelCategoryIds
37
37
* @return array
38
38
*/
39
- public function buildTree (Collection $ collection , array $ topLevelCategories ) : array
39
+ public function buildTree (Collection $ collection , array $ topLevelCategoryIds ) : array
40
40
{
41
41
$ wrapper = $ this ->nodeWrapperFactory ->create ();
42
42
/** @var Category $item */
43
43
foreach ($ collection ->getItems () as $ item ) {
44
44
$ wrapper ->wrap ($ item );
45
45
}
46
46
$ tree = [];
47
- foreach ($ topLevelCategories as $ topLevelCategory ) {
47
+ foreach ($ topLevelCategoryIds as $ topLevelCategory ) {
48
48
$ tree [] = $ wrapper ->getNodeById ($ topLevelCategory )->renderArray ();
49
49
}
50
50
return $ this ->sortTree ($ tree );
You can’t perform that action at this time.
0 commit comments