function ImageStyleDeleteForm::submitForm
Same name in other branches
- 9 core/modules/image/src/Form/ImageStyleDeleteForm.php \Drupal\image\Form\ImageStyleDeleteForm::submitForm()
- 8.9.x core/modules/image/src/Form/ImageStyleDeleteForm.php \Drupal\image\Form\ImageStyleDeleteForm::submitForm()
- 10 core/modules/image/src/Form/ImageStyleDeleteForm.php \Drupal\image\Form\ImageStyleDeleteForm::submitForm()
Overrides EntityDeleteFormTrait::submitForm
File
-
core/
modules/ image/ src/ Form/ ImageStyleDeleteForm.php, line 62
Class
- ImageStyleDeleteForm
- Creates a form to delete an image style.
Namespace
Drupal\image\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
// Save a selected replacement in the image style storage. It will be used
// later, in the same request, when resolving dependencies.
if ($replacement = $form_state->getValue('replacement')) {
/** @var \Drupal\image\ImageStyleStorageInterface $storage */
$storage = $this->entityTypeManager
->getStorage($this->entity
->getEntityTypeId());
$storage->setReplacementId($this->entity
->id(), $replacement);
}
parent::submitForm($form, $form_state);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.