Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SetInlineBlockDependency.php

function 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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal