Skip to content

Commit d5b99c8

Browse files
author
Sergii Kovalenko
committed
MAGETWO-56941: [Github] Allowed countries for customer address in admin using storeview configuration #2946
1 parent 6a3fbf0 commit d5b99c8

File tree

1 file changed

+11
-1
lines changed
  • app/code/Magento/Customer/Model/ResourceModel/Address/Attribute/Source

1 file changed

+11
-1
lines changed

app/code/Magento/Customer/Model/ResourceModel/Address/Attribute/Source/Country.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ class Country extends \Magento\Eav\Model\Entity\Attribute\Source\Table
2727
*/
2828
protected $_countriesFactory;
2929

30+
/**
31+
* @var StoreResolverInterface
32+
*/
33+
private $storeResolver;
34+
3035
/**
3136
* @param \Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\CollectionFactory $attrOptionCollectionFactory
3237
* @param \Magento\Eav\Model\ResourceModel\Entity\Attribute\OptionFactory $attrOptionFactory
@@ -65,11 +70,16 @@ protected function _createCountriesCollection()
6570
}
6671

6772
/**
73+
* Retrieve Store Resolver
6874
* @deprecated
6975
* @return StoreResolverInterface
7076
*/
7177
private function getStoreResolver()
7278
{
73-
return ObjectManager::getInstance()->get(StoreResolverInterface::class);
79+
if (!$this->storeResolver) {
80+
$this->storeResolver = ObjectManager::getInstance()->get(StoreResolverInterface::class);
81+
}
82+
83+
return $this->storeResolver;
7484
}
7585
}

0 commit comments

Comments
 (0)