public function CheeseburgerMenu::blockSubmit in Cheeseburger Menu 8.4
Same name and namespace in other branches
- 8 src/Plugin/Block/CheeseburgerMenu.php \Drupal\cheeseburger_menu\Plugin\Block\CheeseburgerMenu::blockSubmit()
 - 8.2 src/Plugin/Block/CheeseburgerMenu.php \Drupal\cheeseburger_menu\Plugin\Block\CheeseburgerMenu::blockSubmit()
 - 8.3 src/Plugin/Block/CheeseburgerMenu.php \Drupal\cheeseburger_menu\Plugin\Block\CheeseburgerMenu::blockSubmit()
 
Sends and store the block by collected data.
Overrides BlockPluginTrait::blockSubmit
File
- src/
Plugin/ Block/ CheeseburgerMenu.php, line 468  - Cheeseburger class extends BlockBase.
 
Class
- CheeseburgerMenu
 - Block info.
 
Namespace
Drupal\cheeseburger_menu\Plugin\BlockCode
public function blockSubmit($form, FormStateInterface $form_state) {
  foreach ($form_state
    ->getValues() as $key => $value) {
    $this->configuration[$key] = $value;
  }
  $this
    ->unsetNotSelected($this->configuration['menu']);
  $this
    ->unsetNotSelected($this->configuration['taxonomy_vocabulary']);
  $form_object = $form_state
    ->getFormObject();
  if (method_exists($form_object, 'getEntity')) {
    $entity = $form_object
      ->getEntity();
    $this->configuration['block_machine_name'] = $entity
      ->id();
  }
  parent::blockSubmit($form, $form_state);
}