You are here

trait TranslationsHelperTrait in Layout Builder Symmetric Translations 8

Trait for methods that will be added to \Drupal\layout_builder\LayoutEntityHelperTrait

Hierarchy

4 files declare their use of TranslationsHelperTrait
ComponentPluginTranslate.php in src/EventSubscriber/ComponentPluginTranslate.php
LayoutBuilder.php in src/Element/LayoutBuilder.php
LayoutBuilderTranslationAccessCheck.php in src/Access/LayoutBuilderTranslationAccessCheck.php
OverridesEntityForm.php in src/Form/OverridesEntityForm.php

File

src/TranslationsHelperTrait.php, line 12

Namespace

Drupal\layout_builder_st
View source
trait TranslationsHelperTrait {

  /**
   * Determines if the sections is for a translation.
   *
   * @param \Drupal\layout_builder\SectionStorageInterface $section_storage
   *   The section storage.
   *
   * @return bool
   *   TRUE if the section storage is for translation otherwise false.
   */
  protected static function isTranslation(SectionStorageInterface $section_storage) {
    return $section_storage instanceof TranslatableSectionStorageInterface && !$section_storage
      ->isDefaultTranslation();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TranslationsHelperTrait::isTranslation protected static function Determines if the sections is for a translation.