You are here

protected function LayoutEntityHelperTrait::isLayoutCompatibleEntity in Drupal 9

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

Determines if an entity can have a layout.

Parameters

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

Return value

bool TRUE if the entity can have a layout otherwise FALSE.

2 calls to LayoutEntityHelperTrait::isLayoutCompatibleEntity()
InlineBlockEntityOperations::handlePreSave in core/modules/layout_builder/src/InlineBlockEntityOperations.php
Handles saving a parent entity.
SetInlineBlockDependency::getInlineBlockDependency in core/modules/layout_builder/src/EventSubscriber/SetInlineBlockDependency.php
Get the access dependency of an inline block.

File

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

Class

LayoutEntityHelperTrait
Methods to help with entities using the layout builder.

Namespace

Drupal\layout_builder

Code

protected function isLayoutCompatibleEntity(EntityInterface $entity) {
  return $this
    ->getSectionStorageForEntity($entity) !== NULL;
}