You are here

public function TamperEditForm::submitForm in Feeds Tamper 8.2

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/TamperEditForm.php, line 52

Class

TamperEditForm
Tamper edit form.

Namespace

Drupal\feeds_tamper\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $tamper_meta = $this->feedTypeTamperManager
    ->getTamperMeta($this->feedsFeedType);
  $uuid = $this->plugin
    ->getSetting('uuid');
  $tampers_config = $tamper_meta
    ->getTampers()
    ->getConfiguration();
  $config = $this
    ->prepareConfig($tampers_config[$uuid]['source'], $form_state);
  $tamper_meta
    ->setTamperConfig($uuid, $config);
  $this->feedsFeedType
    ->save();
  $this
    ->messenger()
    ->addStatus($this
    ->t('The plugin %plugin_label has been updated.', [
    '%plugin_label' => $this->plugin
      ->getPluginDefinition()['label'],
  ]));
}