36
36
/**
37
37
* @inheritdoc
38
38
*
39
+ * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
39
40
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
40
41
* @SuppressWarnings(PHPMD.TooManyFields)
41
42
*/
@@ -280,7 +281,7 @@ public function __construct(
280
281
*/
281
282
public function get ($ sku , $ editMode = false , $ storeId = null , $ forceReload = false )
282
283
{
283
- $ cacheKey = $ this ->getCacheKey ([$ editMode , $ storeId ]);
284
+ $ cacheKey = $ this ->getCacheKey ([$ editMode , $ storeId === null ? $ storeId : ( int ) $ storeId ]);
284
285
$ cachedProduct = $ this ->getProductFromLocalCache ($ sku , $ cacheKey );
285
286
if ($ cachedProduct === null || $ forceReload ) {
286
287
$ product = $ this ->productFactory ->create ();
@@ -295,7 +296,7 @@ public function get($sku, $editMode = false, $storeId = null, $forceReload = fal
295
296
$ product ->setData ('_edit_mode ' , true );
296
297
}
297
298
if ($ storeId !== null ) {
298
- $ product ->setData ('store_id ' , $ storeId );
299
+ $ product ->setData ('store_id ' , ( int ) $ storeId );
299
300
}
300
301
$ product ->load ($ productId );
301
302
$ this ->cacheProduct ($ cacheKey , $ product );
@@ -522,6 +523,7 @@ protected function processMediaGallery(ProductInterface $product, $mediaGalleryE
522
523
* @inheritdoc
523
524
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
524
525
* @SuppressWarnings(PHPMD.NPathComplexity)
526
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
525
527
*/
526
528
public function save (ProductInterface $ product , $ saveOptions = false )
527
529
{
0 commit comments