Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 5411c0d

Browse files
committed
[Forwardport] Cast products getStoreId() to int
1 parent 8460e4e commit 5411c0d

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

app/code/Magento/Catalog/Model/Category.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ class Category extends \Magento\Catalog\Model\AbstractModel implements
7272

7373
const CACHE_TAG = 'cat_c';
7474

75+
/**
76+
* Category Store Id
77+
*/
78+
const STORE_ID = 'store_id';
79+
7580
/**#@-*/
7681
protected $_eventPrefix = 'catalog_category';
7782

@@ -564,12 +569,12 @@ public function getStoreIds()
564569
*
565570
* If store id is underfined for category return current active store id
566571
*
567-
* @return integer
572+
* @return int
568573
*/
569574
public function getStoreId()
570575
{
571-
if ($this->hasData('store_id')) {
572-
return (int)$this->_getData('store_id');
576+
if ($this->hasData(self::STORE_ID)) {
577+
return (int)$this->_getData(self::STORE_ID);
573578
}
574579
return (int)$this->_storeManager->getStore()->getId();
575580
}
@@ -585,7 +590,7 @@ public function setStoreId($storeId)
585590
if (!is_numeric($storeId)) {
586591
$storeId = $this->_storeManager->getStore($storeId)->getId();
587592
}
588-
$this->setData('store_id', $storeId);
593+
$this->setData(self::STORE_ID, $storeId);
589594
$this->getResource()->setStoreId($storeId);
590595
return $this;
591596
}

app/code/Magento/Catalog/Model/Product.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,9 @@ protected function getCustomAttributesCodes()
526526
public function getStoreId()
527527
{
528528
if ($this->hasData(self::STORE_ID)) {
529-
return $this->getData(self::STORE_ID);
529+
return (int)$this->getData(self::STORE_ID);
530530
}
531-
return $this->_storeManager->getStore()->getId();
531+
return (int)$this->_storeManager->getStore()->getId();
532532
}
533533

534534
/**

0 commit comments

Comments
 (0)