You are here

public function EntitySubmenuBlock::blockSubmit in Entity Submenu Block 8

Overrides SystemMenuBlock::blockSubmit

File

src/Plugin/Block/EntitySubmenuBlock.php, line 143

Class

EntitySubmenuBlock
Provides an Entity Submenu Block.

Namespace

Drupal\entity_submenu_block\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  foreach ([
    'display_non_entities',
    'only_current_language',
  ] as $field) {
    $this
      ->setConfigurationValue($field, $form_state
      ->getValue($field));
  }
  foreach ($this
    ->getEntityTypes() as $entity_type) {
    $field = 'view_mode_' . $entity_type;
    $value = $form_state
      ->getValue($field);
    $this
      ->setConfigurationValue($field, $value);
  }
}