public function ImageAPIOptimizePipelineDeleteForm::submitForm in Image Optimize (or ImageAPI Optimize) 8.2
Same name and namespace in other branches
- 8.3 src/Form/ImageAPIOptimizePipelineDeleteForm.php \Drupal\imageapi_optimize\Form\ImageAPIOptimizePipelineDeleteForm::submitForm()
- 4.x src/Form/ImageAPIOptimizePipelineDeleteForm.php \Drupal\imageapi_optimize\Form\ImageAPIOptimizePipelineDeleteForm::submitForm()
Overrides EntityDeleteFormTrait::submitForm
File
- src/
Form/ ImageAPIOptimizePipelineDeleteForm.php, line 60
Class
- ImageAPIOptimizePipelineDeleteForm
- Creates a form to delete an image optimize pipeline.
Namespace
Drupal\imageapi_optimize\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
// Save a selected replacement in the image optimize pipeline storage. It will be used
// later, in the same request, when resolving dependencies.
if ($replacement = $form_state
->getValue('replacement')) {
/** @var \Drupal\imageapi_optimize\ImageAPIOptimizePipelineStorageInterface $storage */
$storage = $this->entityTypeManager
->getStorage($this->entity
->getEntityTypeId());
$storage
->setReplacementId($this->entity
->id(), $replacement);
}
parent::submitForm($form, $form_state);
}