$destinations[] =
[ 'route_name' => "entity.field_config.{
$this->entityTypeId
}_field_edit_form",
'route_parameters' =>
$route_parameters,
];
$destinations[] =
[ 'route_name' => "entity.{
$this->entityTypeId
}.field_ui_fields",
'route_parameters' =>
$route_parameters,
];
$destination =
$this->
getDestinationArray();
$destinations[] =
$destination['destination'
];
$form_state->
setRedirectUrl( FieldUI::
getNextDestination($destinations) );
// Store new field information for any additional submit handlers.
$form_state->
set(['fields_added', '_add_new_field'
],
$field_name);
$this->
messenger()->
addMessage($this->
t('Your settings have been saved.'
));
} /**
* Get default options from preconfigured options for a new field.
*
* @param string $field_name
* The machine name of the field.
* @param string $preset_key
* A key in the preconfigured options array for the field.
*
* @return array
* An array of settings with keys 'field_storage_config', 'field_config',
* 'entity_form_display', and 'entity_view_display'.
*
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*
* @see \Drupal\Core\Field\PreconfiguredFieldUiOptionsInterface::getPreconfiguredOptions()
*/