protected function _prepareForm()
{
$model = $this->getModel();
/** @var \Magento\Framework\Data\Form $form */
$form = $this->_formFactory->create(['data' => ['id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post']]);
$fieldset = $form->addFieldset('base_fieldset', ['legend' => __('General Information')]);
if ($model->getId()) {
$fieldset->addField('thesaurus_id', 'hidden', ['name' => 'thesaurus_id']);
}
if ($model->getType()) {
$fieldset->addField('type', 'hidden', ['name' => 'type']);
}
$this->initBaseFields($fieldset, $model);
$this->initTypeFields($fieldset, $model);
$form->setValues($model->getData());
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}