public EntityBundleListener::onBundleDelete($bundle, $entity_type_id)
Reacts to a bundle being deleted.
This method runs before fields are deleted.
Parameters
string $bundle: The name of the bundle being deleted.
string $entity_type_id: The entity type to which the bundle is bound; e.g. 'node' or 'user'.
Overrides EntityBundleListenerInterface::onBundleDelete
File
- core/lib/Drupal/Core/Entity/EntityBundleListener.php, line 76
Class
- EntityBundleListener
- Reacts to entity bundle CRUD on behalf of the Entity system.
Namespace
Drupal\Core\Entity
Code
1 2 3 4 5 6 7 8 9 10 11 | public function onBundleDelete( $bundle , $entity_type_id ) { $this ->entityTypeBundleInfo->clearCachedBundles(); // Notify the entity storage. $storage = $this ->entityTypeManager->getStorage( $entity_type_id ); if ( $storage instanceof EntityBundleListenerInterface) { $storage ->onBundleDelete( $bundle , $entity_type_id ); } // Invoke hook_entity_bundle_delete() hook. $this ->moduleHandler->invokeAll( 'entity_bundle_delete' , [ $entity_type_id , $bundle ]); $this ->entityFieldManager->clearCachedFieldDefinitions(); } |
Please login to continue.