You are here

protected function SetInlineBlockDependency::isBlockRevisionUsedInEntity in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/src/EventSubscriber/SetInlineBlockDependency.php \Drupal\layout_builder\EventSubscriber\SetInlineBlockDependency::isBlockRevisionUsedInEntity()

Determines if a block content revision is used in an entity.

Parameters

\Drupal\Core\Entity\EntityInterface $layout_entity: The layout entity.

\Drupal\block_content\BlockContentInterface $block_content: The block content revision.

Return value

bool TRUE if the block content revision is used as an inline block in the layout entity.

1 call to SetInlineBlockDependency::isBlockRevisionUsedInEntity()
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/EventSubscriber/SetInlineBlockDependency.php, line 155

Class

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

Namespace

Drupal\layout_builder\EventSubscriber

Code

protected function isBlockRevisionUsedInEntity(EntityInterface $layout_entity, BlockContentInterface $block_content) {
  $sections_blocks_revision_ids = $this
    ->getInlineBlockRevisionIdsInSections($this
    ->getEntitySections($layout_entity));
  return in_array($block_content
    ->getRevisionId(), $sections_blocks_revision_ids);
}