function LayoutEntityHelperTrait::isLayoutCompatibleEntity

Same name in other branches
  1. 9 core/modules/layout_builder/src/LayoutEntityHelperTrait.php \Drupal\layout_builder\LayoutEntityHelperTrait::isLayoutCompatibleEntity()
  2. 8.9.x core/modules/layout_builder/src/LayoutEntityHelperTrait.php \Drupal\layout_builder\LayoutEntityHelperTrait::isLayoutCompatibleEntity()
  3. 11.x 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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.