You are here

protected function InlineBlockEntityOperations::saveInlineBlockComponent in Layout Builder Symmetric Translations 8

Override to ::saveTranslatedInlineBlock() for translations.

Overrides InlineBlockEntityOperations::saveInlineBlockComponent

File

src/InlineBlockEntityOperations.php, line 54

Class

InlineBlockEntityOperations
Overrides cores InlineBlockEntityOperations to provide translation operations.

Namespace

Drupal\layout_builder_st

Code

protected function saveInlineBlockComponent(EntityInterface $entity, SectionComponent $component, $new_revision, $duplicate_blocks) {
  $section_storage = $this
    ->getSectionStorageForEntity($entity);
  if (static::isTranslation($section_storage)) {

    /** @var  \Drupal\layout_builder_st\TranslatableSectionStorageInterface $section_storage */
    $translated_component_configuration = $section_storage
      ->getTranslatedComponentConfiguration($component
      ->getUuid());
    if (isset($translated_component_configuration['block_serialized'])) {
      $this
        ->saveTranslatedInlineBlock($entity, $component
        ->getUuid(), $translated_component_configuration, $new_revision);
    }
  }
  else {
    parent::saveInlineBlockComponent($entity, $component, $new_revision, $duplicate_blocks);
  }
}