saveBlockContent example


  protected function saveInlineBlockComponent(EntityInterface $entity, SectionComponent $component$new_revision$duplicate_blocks) {
    /** @var \Drupal\layout_builder\Plugin\Block\InlineBlock $plugin */
    $plugin = $component->getPlugin();
    $pre_save_configuration = $plugin->getConfiguration();
    $plugin->saveBlockContent($new_revision$duplicate_blocks);
    $post_save_configuration = $plugin->getConfiguration();
    if ($duplicate_blocks || (empty($pre_save_configuration['block_revision_id']) && !empty($post_save_configuration['block_revision_id']))) {
      $this->usage->addUsage($this->getPluginBlockId($plugin)$entity);
    }
    $component->setConfiguration($post_save_configuration);
  }

}
Home | Imprint | This part of the site doesn't use cookies.