You are here

public function InlineBlockUX::blockSubmit in Layout Builder UX 8

Overrides InlineBlock::blockSubmit

File

src/Plugin/Block/InlineBlockUX.php, line 53

Class

InlineBlockUX
Alters the inline block form.

Namespace

Drupal\lb_ux\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  parent::blockSubmit($form, $form_state);
  if ($form_state
    ->has('lb_ux.inline_block_count')) {

    /** @var \Drupal\layout_builder\SectionStorageInterface $section_storage */
    $section_storage = $form_state
      ->getFormObject()
      ->getSectionStorage();
    $this->keyValueFactory
      ->get('lb_ux.inline_block_count.' . $section_storage
      ->getStorageType())
      ->set($section_storage
      ->getStorageId(), $form_state
      ->get('lb_ux.inline_block_count'));
  }
}