public static function FixedBlockContent::postDelete in Fixed Block Content 8
Acts on deleted entities before the delete hook is invoked.
Used after the entities are deleted but before invoking the delete hook.
Parameters
\Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object.
\Drupal\Core\Entity\EntityInterface[] $entities: An array of entities.
Overrides EntityBase::postDelete
File
- src/
Entity/ FixedBlockContent.php, line 246
Class
- FixedBlockContent
- Configuration entity for the fixed block content.
Namespace
Drupal\fixed_block_content\EntityCode
public static function postDelete(EntityStorageInterface $storage, array $entities) {
parent::postDelete($storage, $entities);
static::invalidateBlockPluginCache();
/** @var \Drupal\fixed_block_content\FixedToContentMappingHandler $mapping_handler */
$mapping_handler = \Drupal::entityTypeManager()
->getHandler('fixed_block_content', 'mapping_handler');
foreach ($entities as $entity) {
// Release the fixed block content.
$mapping_handler
->releaseBlockContent($entity);
}
}