Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

\Drupal\Core\Entity\EntityStorageException

Fichier

src/Form/SpambotUserspamForm.php, line 298

Classe

SpambotUserspamForm
Settings form to save the configuration for Spambot.

Namespace

Drupal\spambot\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    $values = $form_state->getValues();
    
    /** @var \Drupal\user\UserInterface $account */
    $account = $this->entityTypeManager
        ->getStorage('user')
        ->load($values['uid']);
    $config = $this->config('spambot.settings');
    if ($form_state->getValue('op') == $form_state->getValue('check')) {
        static::checkSubmit($account, $config);
    }
    elseif ($form_state->getValue('op') == $form_state->getValue('action')) {
        static::actionSubmit($form_state, $account, $config, $values);
    }
}