/**
  * {@inheritdoc}
  */
 public function getGroupId()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getGroupId');
     if (!$pluginInfo) {
         return parent::getGroupId();
     } else {
         return $this->___callPlugins('getGroupId', func_get_args(), $pluginInfo);
     }
 }
Beispiel #2
0
 /**
  * Prepare group id field in the fieldset
  *
  * @param \Magento\Framework\Data\Form $form
  * @param \Magento\Store\Model\Store $storeModel
  * @param \Magento\Framework\Data\Form\Element\Fieldset $fieldset
  * @return \Magento\Framework\Data\Form\Element\Fieldset
  */
 private function prepareGroupIdField(\Magento\Framework\Data\Form $form, \Magento\Store\Model\Store $storeModel, \Magento\Framework\Data\Form\Element\Fieldset $fieldset)
 {
     if ($storeModel->getId() && $storeModel->getGroup()->getDefaultStoreId() == $storeModel->getId()) {
         if ($storeModel->getGroup() && $storeModel->getGroup()->getStoresCount() > 1) {
             $form->getElement('store_group_id')->setDisabled(true);
             $fieldset->addField('store_hidden_group_id', 'hidden', ['name' => 'store[group_id]', 'no_span' => true, 'value' => $storeModel->getGroupId()]);
         } else {
             $fieldset->addField('store_original_group_id', 'hidden', ['name' => 'store[original_group_id]', 'no_span' => true, 'value' => $storeModel->getGroupId()]);
         }
     }
     return $fieldset;
 }