Author: Romain Ruaud (romain.ruaud@smile.fr)
Inheritance: implements Magento\Framework\Data\OptionSourceInterface
 /**
  * Get scope name and scopeId
  *
  * @return void
  */
 private function initScope()
 {
     if ($this->getSection() === null) {
         $this->setSection('');
     }
     if ($this->getContainer() === null) {
         $this->setContainer('');
     }
     if ($this->getStore() === null) {
         $this->setStore('');
     }
     $scope = 'default';
     $scopeCode = 'default';
     if ($this->getStore()) {
         $scope = 'containers_stores';
         $store = $this->_storeManager->getStore($this->getStore());
         $scopeCode = $store->getId();
         if ($this->getContainer() && $this->getContainer() != "") {
             $scopeCode = $this->getContainer() . "|" . $scopeCode;
         }
     } elseif ($this->getContainer()) {
         $scope = 'containers';
         $container = $this->containersSource->get($this->getContainer());
         $scopeCode = $container['name'];
     }
     $this->setScope($scope);
     $this->setScopeCode($scopeCode);
 }
Exemple #2
0
 /**
  * Get current container name
  *
  * @return string
  */
 public function getCurrentContainerLabel()
 {
     if ($this->getContainerCode() !== null) {
         $container = $this->containersSource->get($this->getContainerCode());
         if ($this->getContainerLabel($container)) {
             return $this->getContainerLabel($container);
         }
     }
 }