$modelManager->
detach($form);
foreach ($form->
getFields() as $field) { $modelManager->
detach($field);
} foreach ($form->
getFields() as $field) { $fieldId =
$field->
getId();
$this->_elements
[$fieldId] =
[ 'id' =>
(string) $fieldId, // intended string cast to keep compatibility
'name' =>
$field->
getName(),
'note' =>
$field->
getNote(),
'typ' =>
$field->
getTyp(),
'required' =>
(string) $field->
getRequired(), // intended string cast to keep compatibility
'label' =>
$field->
getLabel(),
'class' =>
$field->
getClass(),
'value' =>
$field->
getValue(),
'error_msg' =>
$field->
getErrorMsg(),
];
} $this->
translateForm($form,
$this->_elements
);