protected function getInlineBlockDependency(BlockContentInterface
$block_content) { $layout_entity_info =
$this->usage->
getUsage($block_content->
id());
if (empty($layout_entity_info)) { // If the block does not have usage information then we cannot set a
// dependency. It may be used by another module besides layout builder.
return NULL;
} $layout_entity_storage =
$this->entityTypeManager->
getStorage($layout_entity_info->layout_entity_type
);
$layout_entity =
$layout_entity_storage->
load($layout_entity_info->layout_entity_id
);
if ($this->
isLayoutCompatibleEntity($layout_entity)) { if ($this->
isBlockRevisionUsedInEntity($layout_entity,
$block_content)) { return $layout_entity;
} } return NULL;
} /**
* Determines if a block content revision is used in an entity.
*
* @param \Drupal\Core\Entity\EntityInterface $layout_entity
* The layout entity.
* @param \Drupal\block_content\BlockContentInterface $block_content
* The block content revision.
*
* @return bool
* TRUE if the block content revision is used as an inline block in the
* layout entity.
*/