You are here

public function PhoneDonationBlock::blockSubmit in Commerce Donate 8

Adds block type-specific submission handling for the block form.

Note that this method takes the form structure and form state for the full block configuration form as arguments, not just the elements defined in BlockPluginInterface::blockForm().

Parameters

array $form: The form definition array for the full block configuration form.

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

Overrides BlockPluginTrait::blockSubmit

See also

\Drupal\Core\Block\BlockPluginInterface::blockForm()

\Drupal\Core\Block\BlockPluginInterface::blockValidate()

File

src/Plugin/Block/PhoneDonationBlock.php, line 80

Class

PhoneDonationBlock
Provides a Phone to Donate block.

Namespace

Drupal\commerce_donate\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  parent::blockSubmit($form, $form_state);
  $values = $form_state
    ->getValues();
  $this->configuration['intro'] = $values['intro'];
  $this->configuration['main_number'] = $values['main_number']['number'];
  $this->configuration['main_number_label'] = $values['main_number']['label'];
  $this->configuration['intl_number'] = $values['intl_number']['number'];
  $this->configuration['intl_number_label'] = $values['intl_number']['label'];
}