This repository was archived by the owner on Apr 29, 2019. It is now read-only.
File tree 2 files changed +11
-6
lines changed
app/code/Magento/Catalog/Model
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,11 @@ class Category extends \Magento\Catalog\Model\AbstractModel implements
72
72
73
73
const CACHE_TAG = 'cat_c ' ;
74
74
75
+ /**
76
+ * Category Store Id
77
+ */
78
+ const STORE_ID = 'store_id ' ;
79
+
75
80
/**#@-*/
76
81
protected $ _eventPrefix = 'catalog_category ' ;
77
82
@@ -564,12 +569,12 @@ public function getStoreIds()
564
569
*
565
570
* If store id is underfined for category return current active store id
566
571
*
567
- * @return integer
572
+ * @return int
568
573
*/
569
574
public function getStoreId ()
570
575
{
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 );
573
578
}
574
579
return (int )$ this ->_storeManager ->getStore ()->getId ();
575
580
}
@@ -585,7 +590,7 @@ public function setStoreId($storeId)
585
590
if (!is_numeric ($ storeId )) {
586
591
$ storeId = $ this ->_storeManager ->getStore ($ storeId )->getId ();
587
592
}
588
- $ this ->setData (' store_id ' , $ storeId );
593
+ $ this ->setData (self :: STORE_ID , $ storeId );
589
594
$ this ->getResource ()->setStoreId ($ storeId );
590
595
return $ this ;
591
596
}
Original file line number Diff line number Diff line change @@ -526,9 +526,9 @@ protected function getCustomAttributesCodes()
526
526
public function getStoreId ()
527
527
{
528
528
if ($ this ->hasData (self ::STORE_ID )) {
529
- return $ this ->getData (self ::STORE_ID );
529
+ return ( int ) $ this ->getData (self ::STORE_ID );
530
530
}
531
- return $ this ->_storeManager ->getStore ()->getId ();
531
+ return ( int ) $ this ->_storeManager ->getStore ()->getId ();
532
532
}
533
533
534
534
/**
You can’t perform that action at this time.
0 commit comments