45 private $_isAdminScopeAllowed =
true;
71 $this->_websiteCollection = $this->_storeManager->getWebsites();
82 $this->_groupCollection = [];
83 foreach ($this->_storeManager->getWebsites() as
$website) {
98 $this->_storeCollection = $this->_storeManager->getStores();
115 $options[] = [
'label' =>
'',
'value' =>
''];
117 if ($all && $this->_isAdminScopeAllowed) {
118 $options[] = [
'label' =>
__(
'All Store Views'),
'value' => 0];
121 $nonEscapableNbspChar = html_entity_decode(
' ', ENT_NOQUOTES,
'UTF-8');
123 foreach ($this->_websiteCollection as
$website) {
124 $websiteShow =
false;
125 foreach ($this->_groupCollection as
$group) {
130 foreach ($this->_storeCollection as
$store) {
143 'label' => str_repeat($nonEscapableNbspChar, 4) .
$store->getName(),
144 'value' =>
$store->getId(),
149 'label' => str_repeat($nonEscapableNbspChar, 4) .
$group->getName(),
175 $out[] = [
'value' => 0,
'label' =>
__(
'All Store Views')];
187 if ($groupIds && !in_array(
$groupId, $groupIds)) {
194 if ($storeIds && !in_array(
$storeId, $storeIds)) {
199 'label' =>
$store->getName(),
224 $options[] = [
'label' =>
__(
'-- Please Select --'),
'value' =>
''];
226 if ($all && $this->_isAdminScopeAllowed) {
227 $options[] = [
'label' =>
__(
'Admin'),
'value' => 0];
230 foreach ($this->_websiteCollection as
$website) {
246 foreach ($this->_storeManager->getWebsites((
bool)$withDefault && $this->_isAdminScopeAllowed) as
$website) {
262 foreach ($this->_storeManager->getStores((
bool)$withDefault && $this->_isAdminScopeAllowed) as
$store) {
277 foreach ($this->_groupCollection as
$group) {
291 foreach ($this->_websiteCollection as
$website) {
307 foreach ($this->_groupCollection as
$group) {
323 if (isset($this->_storeCollection[
$storeId])) {
324 return $this->_storeCollection[
$storeId]->getName();
337 if (isset($this->_storeCollection[
$storeId])) {
338 return $this->_storeCollection[
$storeId];
357 $name = implode(
', ', $names);
359 if (isset($this->_storeCollection[
$storeId])) {
408 if (
$type ===
null) {
414 case \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE:
417 case \Magento\Store\Model\ScopeInterface::SCOPE_GROUP:
420 case \Magento\Store\Model\ScopeInterface::SCOPE_STORE:
444 $name = implode(
', ', $names);
446 if (isset($this->_storeCollection[
$storeId])) {
463 $this->_isAdminScopeAllowed = (bool)
$value;
getStoreValuesForForm($empty=false, $all=false)
getStoreGroupOptionHash($attribute='name')
getStoreOptionHash($withDefault=false, $attribute='name')
getStoreNameWithWebsite($storeId)
getWebsiteValuesForForm($empty=false, $all=false)
getWebsiteOptionHash($withDefault=false, $attribute='name')
setIsAdminScopeAllowed($value)
getStoresStructure($isAll=false, $storeIds=[], $groupIds=[], $websiteIds=[])
__construct(\Magento\Store\Model\StoreManagerInterface $storeManager)
getStoreNamePath($storeId)
getWebsiteName($websiteId)
if(!isset($_GET['name'])) $name