You are here

public function SolrFieldTypeDeleteForm::submitForm in Search API Solr 4.x

Same name and namespace in other branches
  1. 8.3 src/Form/SolrFieldTypeDeleteForm.php \Drupal\search_api_solr\Form\SolrFieldTypeDeleteForm::submitForm()
  2. 8.2 src/Form/SolrFieldTypeDeleteForm.php \Drupal\search_api_solr\Form\SolrFieldTypeDeleteForm::submitForm()

Throws

\Drupal\Core\Entity\EntityMalformedException

\Drupal\Core\Entity\EntityStorageException

Overrides EntityForm::submitForm

File

src/Form/SolrFieldTypeDeleteForm.php, line 42

Class

SolrFieldTypeDeleteForm
Builds the form to delete a SolrFieldType.

Namespace

Drupal\search_api_solr\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->entity
    ->delete();
  \Drupal::messenger()
    ->addStatus($this
    ->t('content @type: deleted @label.', [
    '@type' => $this->entity
      ->bundle(),
    '@label' => $this->entity
      ->label(),
  ]));
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}