/** * prepare form * @return $this */ protected function _prepareForm() { parent::_prepareForm(); $this->getForm()->setHtmlIdPrefix('entity_' . $this->getIncrement() . '_'); $this->getForm()->addFieldNameSuffix('entity[' . $this->getIncrement() . ']'); if ($this->getEntity()) { $this->getForm()->setValues($this->getEntity()->getData()); } else { $this->getForm()->setValues($this->_scopeConfig->getValue('umc/' . $this->model->getEntityCode())); } return $this; }
/** * prepare the form * * @return $this */ protected function _prepareForm() { parent::_prepareForm(); $this->getForm()->setHtmlIdPrefix($this->model->getEntityCode()); $this->getForm()->addFieldNameSuffix($this->model->getEntityCode()); /** @var \Umc\Base\Model\Core\Module $module */ $module = $this->_coreRegistry->registry('current_module'); if ($module && count($module->getData())) { $this->getForm()->addValues($module->getData()); } else { $this->getForm()->addValues($this->_scopeConfig->getValue('umc/' . $this->model->getEntityCode())); } return $this; }