function InlineBlockEntityOperations::deleteBlocksAndUsage
Delete the inline blocks and the usage records.
Parameters
int[] $block_content_ids: The block content entity IDs.
2 calls to InlineBlockEntityOperations::deleteBlocksAndUsage()
- InlineBlockEntityOperations::removeUnused in core/
modules/ layout_builder/ src/ InlineBlockEntityOperations.php - Removes unused inline blocks.
- InlineBlockEntityOperations::removeUnusedForEntityOnSave in core/
modules/ layout_builder/ src/ InlineBlockEntityOperations.php - Remove all unused inline blocks on save.
File
-
core/
modules/ layout_builder/ src/ InlineBlockEntityOperations.php, line 179
Class
- InlineBlockEntityOperations
- Defines a class for reacting to entity events related to Inline Blocks.
Namespace
Drupal\layout_builderCode
protected function deleteBlocksAndUsage(array $block_content_ids) {
foreach ($block_content_ids as $block_content_id) {
if ($block = $this->blockContentStorage
->load($block_content_id)) {
$block->delete();
}
}
$this->usage
->deleteUsage($block_content_ids);
}