From 9f8be4c45d9472a1017a8455fc42423001af6f99 Mon Sep 17 00:00:00 2001 From: Leonid Poluyanov <lpoluyanov@magento.com> Date: Mon, 18 Dec 2017 12:15:06 +0200 Subject: [PATCH] MAGETWO-84448: Product Import does not allow store-specific Custom Option labels --- .../Model/Export/RowCustomizer.php | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/BundleImportExport/Model/Export/RowCustomizer.php b/app/code/Magento/BundleImportExport/Model/Export/RowCustomizer.php index 0f58b82872d..376de359f25 100644 --- a/app/code/Magento/BundleImportExport/Model/Export/RowCustomizer.php +++ b/app/code/Magento/BundleImportExport/Model/Export/RowCustomizer.php @@ -126,6 +126,15 @@ class RowCustomizer implements RowCustomizerInterface */ private $storeManager; + /** + * @param StoreManagerInterface $storeManager + * @throws \RuntimeException + */ + public function __construct(StoreManagerInterface $storeManager = null) + { + $this->storeManager = $storeManager ?: ObjectManager::getInstance()->get(StoreManagerInterface::class); + } + /** * Retrieve list of bundle specific columns * @return array @@ -475,22 +484,8 @@ class RowCustomizer implements RowCustomizerInterface private function getStoreCodeById($storeId) { if (!isset($this->storeIdToCode[$storeId])) { - $this->storeIdToCode[$storeId] = $this->getStoreManager()->getStore($storeId)->getCode(); + $this->storeIdToCode[$storeId] = $this->storeManager->getStore($storeId)->getCode(); } return $this->storeIdToCode[$storeId]; } - - /** - * Initialize StoreManagerInterface if it was not and return it. - * - * @return StoreManagerInterface - * @throws \RuntimeException - */ - private function getStoreManager() - { - if (!$this->storeManager) { - $this->storeManager = ObjectManager::getInstance()->get(StoreManagerInterface::class); - } - return $this->storeManager; - } } -- GitLab