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

Breadcrumb

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

function LayoutEntityHelperTrait::getInlineBlockComponents

Gets components that have Inline Block plugins.

Parameters

\Drupal\layout_builder\Section[] $sections: The layout sections.

Return value

\Drupal\layout_builder\SectionComponent[] The components that contain Inline Block plugins.

2 calls to LayoutEntityHelperTrait::getInlineBlockComponents()
InlineBlockEntityOperations::handlePreSave in core/modules/layout_builder/src/InlineBlockEntityOperations.php
Handles saving a parent entity.
LayoutEntityHelperTrait::getInlineBlockRevisionIdsInSections in core/modules/layout_builder/src/LayoutEntityHelperTrait.php
Gets revision IDs for layout sections.

File

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

Class

LayoutEntityHelperTrait
Methods to help with entities using the layout builder.

Namespace

Drupal\layout_builder

Code

protected function getInlineBlockComponents(array $sections) {
    $inline_block_components = [];
    foreach ($sections as $section) {
        foreach ($section->getComponents() as $component) {
            $plugin = $component->getPlugin();
            if ($plugin instanceof DerivativeInspectionInterface && $plugin->getBaseId() === 'inline_block') {
                $inline_block_components[] = $component;
            }
        }
    }
    return $inline_block_components;
}

API Navigation

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