function ContactForm::save

Same name in other branches
  1. 8.x-1.x content_entity_example/src/Form/ContactForm.php \Drupal\content_entity_example\Form\ContactForm::save()
  2. 4.0.x modules/content_entity_example/src/Form/ContactForm.php \Drupal\content_entity_example\Form\ContactForm::save()

Overrides EntityForm::save

File

modules/content_entity_example/src/Form/ContactForm.php, line 36

Class

ContactForm
Form controller for the content_entity_example entity edit forms.

Namespace

Drupal\content_entity_example\Form

Code

public function save(array $form, FormStateInterface $form_state) {
    $form_state->setRedirect('entity.content_entity_example_contact.collection');
    $entity = $this->getEntity();
    $entity->save();
}