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

Breadcrumb

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

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_builder

Code

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

API Navigation

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