Skip to content

Commit 2929dfa

Browse files
authored
ENGCOM-4081: graphQl-336: Magento/CatalogGraphQl/Model/Category/LevelCalculator class has fields declared dynamically #337
2 parents 8222455 + f5ad6ec commit 2929dfa

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/code/Magento/CatalogGraphQl/Model/Category/LevelCalculator.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@
1515
*/
1616
class LevelCalculator
1717
{
18+
/**
19+
* @var ResourceConnection
20+
*/
21+
private $resourceConnection;
22+
23+
/**
24+
* @var Category
25+
*/
26+
private $resourceCategory;
27+
1828
/**
1929
* @param ResourceConnection $resourceConnection
2030
* @param Category $resourceCategory
@@ -39,6 +49,7 @@ public function calculate(int $rootCategoryId) : int
3949
$select = $connection->select()
4050
->from($this->resourceConnection->getTableName('catalog_category_entity'), 'level')
4151
->where($this->resourceCategory->getLinkField() . " = ?", $rootCategoryId);
52+
4253
return (int) $connection->fetchOne($select);
4354
}
4455
}

0 commit comments

Comments
 (0)