public function Edit::submitForm in SimpleAds 8
Same name in this branch
- 8 src/Form/Groups/Edit.php \Drupal\simpleads\Form\Groups\Edit::submitForm()
- 8 src/Form/Ads/Edit.php \Drupal\simpleads\Form\Ads\Edit::submitForm()
- 8 src/Form/Campaigns/Edit.php \Drupal\simpleads\Form\Campaigns\Edit::submitForm()
Form submission handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormInterface::submitForm
File
- src/
Form/ Groups/ Edit.php, line 72
Class
- Edit
- Edit advertisement group form.
Namespace
Drupal\simpleads\Form\GroupsCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$group = (new Groups())
->setId($form_state
->getValue('id'))
->load();
(new Groups())
->setId($form_state
->getValue('id'))
->setName($form_state
->getValue('name'))
->setDescription($form_state
->getValue('description'))
->setCreatedAt($group
->getCreatedAt())
->save();
$form_state
->setRedirect('simpleads.groups');
}