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

Breadcrumb

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

function BlockContent::postDelete

Overrides EntityBase::postDelete

File

core/modules/block_content/src/Entity/BlockContent.php, line 166

Class

BlockContent
Defines the content block entity class.

Namespace

Drupal\block_content\Entity

Code

public static function postDelete(EntityStorageInterface $storage, array $entities) {
    parent::postDelete($storage, $entities);
    
    /** @var \Drupal\block_content\BlockContentInterface $block */
    foreach ($entities as $block) {
        if ($block->isReusable()) {
            // If any deleted blocks are reusable clear the block cache.
            static::invalidateBlockPluginCache();
            return;
        }
    }
}

API Navigation

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