Skip to content

Commit

Permalink
Replace load in the loop with proper data provider
Browse files Browse the repository at this point in the history
  • Loading branch information
lbajsarowicz committed Aug 4, 2020
1 parent d3adb7a commit d8a386e
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions app/code/Magento/Rule/Model/Condition/Product/AbstractProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,23 +657,11 @@ public function validateByEntityId($productId)
* Retrieve category ids where product is available
*
* @param int $productId
* @return array
* @return int[]
*/
protected function _getAvailableInCategories($productId)
{
return $this->_productResource->getConnection()
->fetchCol(
$this->_productResource->getConnection()
->select()
->distinct()
->from(
$this->_productResource->getTable('catalog_category_product'),
['category_id']
)->where(
'product_id = ?',
$productId
)
);
return $this->productCategoryList->getCategoryIds($productId);
}

/**
Expand Down

0 comments on commit d8a386e

Please sign in to comment.