You are here

public function ParserWithMappingForm::mappingFormValidate in Feeds 8.3

Validate handler for the mapping form.

Parameters

array $form: The mapping form definition.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the mapping form.

Overrides MappingPluginFormInterface::mappingFormValidate

File

tests/modules/feeds_test_plugin/src/Feeds/Parser/ParserWithMappingForm.php, line 64

Class

ParserWithMappingForm
Dummy parser to test integration with the Feeds mapping form.

Namespace

Drupal\feeds_test_plugin\Feeds\Parser

Code

public function mappingFormValidate(array &$form, FormStateInterface $form_state) {
  if ($form_state
    ->getValue('dummy') == 'invalid') {
    $form_state
      ->setErrorByName('dummy', 'Invalid value.');
  }
}