You are here

public function OverridesSectionStorage::getTranslatedComponentConfiguration in Layout Builder Symmetric Translations 8

Gets the translated component configuration.

Parameters

string $uuid: The component UUID.

Return value

array The component's translated configuration.

Overrides TranslatableSectionStorageInterface::getTranslatedComponentConfiguration

File

src/Plugin/SectionStorage/OverridesSectionStorage.php, line 74

Class

OverridesSectionStorage

Namespace

Drupal\layout_builder_st\Plugin\SectionStorage

Code

public function getTranslatedComponentConfiguration($uuid) {
  if ($this
    ->getEntity()
    ->get(OverridesSectionStorage::TRANSLATED_CONFIGURATION_FIELD_NAME)
    ->isEmpty()) {
    return [];
  }
  $translation_settings = $this
    ->getEntity()
    ->get(OverridesSectionStorage::TRANSLATED_CONFIGURATION_FIELD_NAME)
    ->getValue()[0];
  return isset($translation_settings['value']['components'][$uuid]) ? $translation_settings['value']['components'][$uuid] : [];
}