function LayoutEntityHelperTrait::getOverridesSectionStorageForEntity

Gets the overrides section storage for an entity.

Parameters

\Drupal\Core\Entity\FieldableEntityInterface $entity: The entity with the overridden layout.

Return value

\Drupal\layout_builder\OverridesSectionStorageInterface|null The overrides section storage if found otherwise NULL.

1 call to LayoutEntityHelperTrait::getOverridesSectionStorageForEntity()
LayoutOverrideFieldHelper::updateTempstoreEntityContext in core/modules/layout_builder/src/LayoutOverrideFieldHelper.php
Updates a layout overrides's entity context when entity values change.

File

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

Class

LayoutEntityHelperTrait
Methods to help with entities using the layout builder.

Namespace

Drupal\layout_builder

Code

public function getOverridesSectionStorageForEntity(FieldableEntityInterface $entity) : ?OverridesSectionStorageInterface {
  $contexts = $this->getSectionStorageContextsForEntity($entity);
  return $this->sectionStorageManager()
    ->load('overrides', $contexts);
}

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