You are here

public function AutoBlockScheduler::submitConfigurationForm in Auto Block Scheduler 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Condition/AutoBlockScheduler.php \Drupal\auto_block_scheduler\Plugin\Condition\AutoBlockScheduler::submitConfigurationForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().

Overrides ConditionPluginBase::submitConfigurationForm

File

src/Plugin/Condition/AutoBlockScheduler.php, line 45

Class

AutoBlockScheduler
Provides a 'AutoBlockScheduler ' condition.

Namespace

Drupal\auto_block_scheduler\Plugin\Condition

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  if (is_object($form_state
    ->getValue('published_on'))) {
    $this->configuration['published_on'] = $form_state
      ->getValue('published_on')
      ->getTimestamp();
  }
  else {
    $this->configuration['published_on'] = '';
  }
  if (is_object($form_state
    ->getValue('unpublished_on'))) {
    $this->configuration['unpublished_on'] = $form_state
      ->getValue('unpublished_on')
      ->getTimestamp();
  }
  else {
    $this->configuration['unpublished_on'] = '';
  }
  parent::submitConfigurationForm($form, $form_state);
}