function SetInlineBlockDependency::onGetDependency

Same name in other branches
  1. 8.9.x core/modules/layout_builder/src/EventSubscriber/SetInlineBlockDependency.php \Drupal\layout_builder\EventSubscriber\SetInlineBlockDependency::onGetDependency()
  2. 10 core/modules/layout_builder/src/EventSubscriber/SetInlineBlockDependency.php \Drupal\layout_builder\EventSubscriber\SetInlineBlockDependency::onGetDependency()
  3. 11.x core/modules/layout_builder/src/EventSubscriber/SetInlineBlockDependency.php \Drupal\layout_builder\EventSubscriber\SetInlineBlockDependency::onGetDependency()

Handles the BlockContentEvents::INLINE_BLOCK_GET_DEPENDENCY event.

Parameters

\Drupal\block_content\Event\BlockContentGetDependencyEvent $event: The event.

File

core/modules/layout_builder/src/EventSubscriber/SetInlineBlockDependency.php, line 94

Class

SetInlineBlockDependency
An event subscriber that returns an access dependency for inline blocks.

Namespace

Drupal\layout_builder\EventSubscriber

Code

public function onGetDependency(BlockContentGetDependencyEvent $event) {
    if ($dependency = $this->getInlineBlockDependency($event->getBlockContentEntity())) {
        $event->setAccessDependency($dependency);
    }
}

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