You are here

protected function LayoutEntityHelperTrait::getEntitySections in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/LayoutEntityHelperTrait.php \Drupal\layout_builder\LayoutEntityHelperTrait::getEntitySections()
  2. 9 core/modules/layout_builder/src/LayoutEntityHelperTrait.php \Drupal\layout_builder\LayoutEntityHelperTrait::getEntitySections()

Gets the sections for an entity if any.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity.

Return value

\Drupal\layout_builder\Section[] The entity layout sections if available.

2 calls to LayoutEntityHelperTrait::getEntitySections()
QuickEditLayoutBuilderEntityViewDisplay::getQuickEditSectionComponent in core/modules/quickedit/src/Entity/QuickEditLayoutBuilderEntityViewDisplay.php
Returns the Quick Edit formatter settings.
SetInlineBlockDependency::isBlockRevisionUsedInEntity in core/modules/layout_builder/src/EventSubscriber/SetInlineBlockDependency.php
Determines if a block content revision is used in an entity.

File

core/modules/layout_builder/src/LayoutEntityHelperTrait.php, line 69

Class

LayoutEntityHelperTrait
Methods to help with entities using the layout builder.

Namespace

Drupal\layout_builder

Code

protected function getEntitySections(EntityInterface $entity) {
  $section_storage = $this
    ->getSectionStorageForEntity($entity);
  return $section_storage ? $section_storage
    ->getSections() : [];
}