You are here

public function SimplenewsSubscriptionBlock::blockSubmit in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/Block/SimplenewsSubscriptionBlock.php \Drupal\simplenews\Plugin\Block\SimplenewsSubscriptionBlock::blockSubmit()
  2. 8 src/Plugin/Block/SimplenewsSubscriptionBlock.php \Drupal\simplenews\Plugin\Block\SimplenewsSubscriptionBlock::blockSubmit()

Overrides BlockPluginTrait::blockSubmit

File

src/Plugin/Block/SimplenewsSubscriptionBlock.php, line 149

Class

SimplenewsSubscriptionBlock
Provides a subscription block with all available newsletters and email field.

Namespace

Drupal\simplenews\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  $this->configuration['newsletters'] = array_filter($form_state
    ->getValue('newsletters'));
  $this->configuration['message'] = $form_state
    ->getValue('message');

  // @codingStandardsIgnoreStart

  //$this->configuration['link_previous'] = $form_state->getValue('link_previous');

  //$this->configuration['rss_feed'] = $form_state->getValue('rss_feed');

  // @codingStandardsIgnoreEnd
  $this->configuration['unique_id'] = empty($form_state
    ->getValue('unique_id')) ? \Drupal::service('uuid')
    ->generate() : $form_state
    ->getValue('unique_id');
}