Same name in other branches
- 2.x src/EntityClone/Config/ConfigEntityCloneFormBase.php \Drupal\entity_clone\EntityClone\Config\ConfigEntityCloneFormBase::getValues()
Overrides EntityCloneFormInterface::getValues
Fichier
-
src/
EntityClone/ Config/ ConfigEntityCloneFormBase.php, line 103
Classe
- ConfigEntityCloneFormBase
- Class Config Entity Clone FormBase.
Namespace
Drupal\entity_clone\EntityClone\ConfigCode
public function getValues(FormStateInterface $form_state) {
// If entity must have a prefix
// (e.g. entity_form_mode, entity_view_mode, ...).
$field_prefix = '';
if (isset($form_state->getCompleteForm()['id']['#field_prefix'])) {
$field_prefix = $form_state->getCompleteForm()['id']['#field_prefix'];
}
return [
'id' => $field_prefix . $form_state->getValue('id'),
'label' => $form_state->getValue('label'),
];
}