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 88namespace Magento \CatalogGraphQl \Model \Resolver \Categories \DataProvider \Category \CollectionProcessor ;
99
1010use Magento \Catalog \Api \CategoryRepositoryInterface ;
11- use Magento \Catalog \Model \Category ;
1211use Magento \Catalog \Model \ResourceModel \Category \Collection ;
1312use Magento \CatalogGraphQl \Model \Resolver \Categories \DataProvider \Category \CollectionProcessorInterface ;
1413use Magento \Framework \Api \SearchCriteriaInterface ;
Original file line number Diff line number Diff line change 77
88namespace Magento \CatalogGraphQl \Model \Resolver \Products \DataProvider ;
99
10- use Exception ;
1110use GraphQL \Language \AST \FieldNode ;
1211use GraphQL \Language \AST \NodeKind ;
13- use Iterator ;
1412use Magento \Catalog \Api \Data \CategoryInterface ;
15- use Magento \Catalog \Model \Category ;
1613use Magento \Catalog \Model \ResourceModel \Category \Collection ;
1714use Magento \Catalog \Model \ResourceModel \Category \CollectionFactory ;
1815use Magento \CatalogGraphQl \Model \AttributesJoiner ;
1916use Magento \CatalogGraphQl \Model \Category \DepthCalculator ;
20- use Magento \CatalogGraphQl \Model \Category \LevelCalculator ;
2117use Magento \CatalogGraphQl \Model \Resolver \Categories \DataProvider \Category \CollectionProcessorInterface ;
22- use Magento \Framework \DB \Select ;
2318use Magento \Framework \DB \Sql \Expression ;
2419use Magento \Framework \Api \Search \SearchCriteria ;
2520use Magento \Framework \EntityManager \MetadataPool ;
2621use Magento \Framework \Exception \LocalizedException ;
2722use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
2823use Magento \GraphQl \Model \Query \ContextInterface ;
29- use Magento \Store \Api \Data \StoreInterface ;
3024
3125/**
3226 * Category tree data provider
Original file line number Diff line number Diff line change 99
1010use Magento \Catalog \Model \Category ;
1111use Magento \CatalogGraphQl \Model \Category \Hydrator ;
12- use Magento \Framework \App \ObjectManager ;
1312
1413/**
1514 * 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)
3333 * Build result tree from collection
3434 *
3535 * @param Collection $collection
36- * @param array $topLevelCategories
36+ * @param array $topLevelCategoryIds
3737 * @return array
3838 */
39- public function buildTree (Collection $ collection , array $ topLevelCategories ) : array
39+ public function buildTree (Collection $ collection , array $ topLevelCategoryIds ) : array
4040 {
4141 $ wrapper = $ this ->nodeWrapperFactory ->create ();
4242 /** @var Category $item */
4343 foreach ($ collection ->getItems () as $ item ) {
4444 $ wrapper ->wrap ($ item );
4545 }
4646 $ tree = [];
47- foreach ($ topLevelCategories as $ topLevelCategory ) {
47+ foreach ($ topLevelCategoryIds as $ topLevelCategory ) {
4848 $ tree [] = $ wrapper ->getNodeById ($ topLevelCategory )->renderArray ();
4949 }
5050 return $ this ->sortTree ($ tree );
You can’t perform that action at this time.
0 commit comments