public function save(array
$form, FormStateInterface
$form_state) { $field_label =
$form_state->
get('field_config'
)->
label();
try { $this->entity->
save();
$this->
messenger()->
addStatus($this->
t('Updated field %label field settings.',
['%label' =>
$field_label]));
$request =
$this->
getRequest();
if (($destinations =
$request->query->
all('destinations'
)) &&
$next_destination = FieldUI::
getNextDestination($destinations)) { $request->query->
remove('destinations'
);
$form_state->
setRedirectUrl($next_destination);
} else { $form_state->
setRedirectUrl(FieldUI::
getOverviewRouteInfo($form_state->
get('entity_type_id'
),
$form_state->
get('bundle'
)));
} } catch (\Exception
$e) { $this->
messenger()->
addStatus($this->
t('Attempt to update field %label failed: %message.',
['%label' =>
$field_label, '%message' =>
$e->
getMessage()]));
} } /**
* Returns the cardinality enforced by the field type.
*
* Some field types choose to enforce a fixed cardinality. This method
* returns that cardinality or NULL if no cardinality has been enforced.
*
* @return int|null
*/