function ContentDevelGenerate::settingsFormValidate

Same name in other branches
  1. 4.x devel_generate/src/Plugin/DevelGenerate/ContentDevelGenerate.php \Drupal\devel_generate\Plugin\DevelGenerate\ContentDevelGenerate::settingsFormValidate()
  2. 5.x devel_generate/src/Plugin/DevelGenerate/ContentDevelGenerate.php \Drupal\devel_generate\Plugin\DevelGenerate\ContentDevelGenerate::settingsFormValidate()

Overrides DevelGenerateBase::settingsFormValidate

File

devel_generate/src/Plugin/DevelGenerate/ContentDevelGenerate.php, line 285

Class

ContentDevelGenerate
Provides a ContentDevelGenerate plugin.

Namespace

Drupal\devel_generate\Plugin\DevelGenerate

Code

function settingsFormValidate(array $form, FormStateInterface $form_state) {
    if (!array_filter($form_state->getValue('node_types'))) {
        $form_state->setErrorByName('node_types', $this->t('Please select at least one content type'));
    }
}