Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove strict typing for Mage_Catalog_Model_Product->setStockItem met… #2208

Merged
merged 1 commit into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/code/core/Mage/Catalog/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,10 @@ public function hasStockItem()
}

/**
* @param Mage_CatalogInventory_Model_Stock_Item $stockItem
* @param Varien_Object|Mage_CatalogInventory_Model_Stock_Item $stockItem
* @return $this
*/
public function setStockItem(Mage_CatalogInventory_Model_Stock_Item $stockItem)
public function setStockItem($stockItem)
{
$this->_stockItem = $stockItem;
return $this;
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/CatalogInventory/Model/Stock/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ public function addStockStatusToProducts($productCollection, $websiteId = null,

/* back compatible stock item */
foreach ($productCollection as $product) {
$object = new Varien_Object(array('is_in_stock' => $product->getData('is_salable')));
$object = Mage::getModel('cataloginventory/stock_item', ['is_in_stock' => $product->getData('is_salable')]);
fballiano marked this conversation as resolved.
Show resolved Hide resolved
$product->setStockItem($object);
}

Expand Down