public function CctagsDeleteItemForm::submitForm in cctags 8
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/ CctagsDeleteItemForm.php, line 85
Class
- CctagsDeleteItemForm
- Class LoginDisableSettingsForm.
Namespace
Drupal\cctags\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$conn = Database::getConnection();
$block = Block::load('cctagsblock_' . $this->cctid);
if ($block) {
\Drupal::entityManager()
->getStorage('block')
->delete(array(
'cctagsblock_' . $this->cctid => $block,
));
}
$conn
->delete('cctags')
->condition('cctid', $this->cctid)
->execute();
$form_state
->setRedirect('cctags.settings_form');
}