function BlockContent::preDelete
Same name in other branches
- 10 core/modules/block_content/src/Entity/BlockContent.php \Drupal\block_content\Entity\BlockContent::preDelete()
- 11.x core/modules/block_content/src/Entity/BlockContent.php \Drupal\block_content\Entity\BlockContent::preDelete()
Overrides EntityBase::preDelete
File
-
core/
modules/ block_content/ src/ Entity/ BlockContent.php, line 132
Class
- BlockContent
- Defines the custom block entity class.
Namespace
Drupal\block_content\EntityCode
public static function preDelete(EntityStorageInterface $storage, array $entities) {
parent::preDelete($storage, $entities);
/** @var \Drupal\block_content\BlockContentInterface $block */
foreach ($entities as $block) {
foreach ($block->getInstances() as $instance) {
$instance->delete();
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.