Exemplo n.º 1
0
 /**
  * Set the selected resources, which is an array of resource ids.
  *
  * If everything is allowed, the array will contain just the root resource id, which is "Magento_Backend::all".
  *
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $integrationData = $this->_coreRegistry->registry(IntegrationController::REGISTRY_KEY_CURRENT_INTEGRATION);
     if (is_array($integrationData) && isset($integrationData['integration_id']) && $integrationData['integration_id']) {
         $this->_selectedResources = $this->integrationService->getSelectedResources($integrationData['integration_id']);
     } else {
         $this->_selectedResources = [];
     }
 }
Exemplo n.º 2
0
 /**
  * Class constructor
  *
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $savedFromData = $this->retrieveFormResources();
     if (false !== $savedFromData) {
         $this->setSelectedResources($savedFromData);
         return;
     }
     $integrationData = $this->_coreRegistry->registry(IntegrationController::REGISTRY_KEY_CURRENT_INTEGRATION);
     if (is_array($integrationData) && isset($integrationData['integration_id']) && $integrationData['integration_id']) {
         $this->setSelectedResources($this->integrationService->getSelectedResources($integrationData['integration_id']));
     } else {
         $this->setSelectedResources([]);
     }
 }