public function OAuthDeleteConsumerForm::submitForm in OAuth 1.0 8
Same name and namespace in other branches
- 8.2 src/Form/OAuthDeleteConsumerForm.php \Drupal\oauth\Form\OAuthDeleteConsumerForm::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/ OAuthDeleteConsumerForm.php, line 115 - Contains \Drupal\oauth\Form\OAuthDeleteConsumerForm.
Class
- OAuthDeleteConsumerForm
- Provides an oauth_consumer deletion confirmation form.
Namespace
Drupal\oauth\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$values = $form_state
->getValues();
$cid = $values['cid'];
$this->connection
->delete('oauth_consumer')
->condition('cid', $cid)
->execute();
drupal_set_message($this
->t('OAuth consumer deleted.'));
$form_state
->setRedirect('oauth.user_consumer', [
'user' => \Drupal::currentUser()
->id(),
]);
}