Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LayoutEntityHelperTrait.php

function 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.

3 calls to LayoutEntityHelperTrait::getEntitySections()
InlineBlockEntityOperations::getRemovedBlockIds in core/modules/layout_builder/src/InlineBlockEntityOperations.php
Gets the IDs of the inline blocks that were removed.
InlineBlockEntityOperations::handlePreSave in core/modules/layout_builder/src/InlineBlockEntityOperations.php
Handles saving a parent entity.
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() : [];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal