Skip to content

Commit c16a510

Browse files
committed
B2B-2469: Improve category children loading
- codestyle fixes
1 parent 9ebe65b commit c16a510

File tree

1 file changed

+9
-4
lines changed
  • app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree/Wrapper

1 file changed

+9
-4
lines changed

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree/Wrapper/Forgery.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ class Forgery
2828
*/
2929
private $hydrator;
3030

31+
/**
32+
* @param Hydrator $hydrator
33+
*/
34+
public function __construct(Hydrator $hydrator)
35+
{
36+
$this->hydrator = $hydrator;
37+
}
38+
3139
/**
3240
* Forge the node and put it into index.
3341
*
@@ -79,13 +87,10 @@ public function hasNodeById(int $id) : bool
7987
/**
8088
* Get category hydrator.
8189
*
82-
* @return Hydrator|mixed
90+
* @return Hydrator
8391
*/
8492
public function getHydrator()
8593
{
86-
if (!$this->hydrator instanceof Hydrator) {
87-
$this->hydrator = ObjectManager::getInstance()->get(Hydrator::class);
88-
}
8994
return $this->hydrator;
9095
}
9196
}

0 commit comments

Comments
 (0)