3 namespace Drupal\Core\Entity;
6 * An interface for reacting to entity bundle creation and deletion.
8 * @todo Convert to Symfony events: https://www.drupal.org/node/2332935
10 interface EntityBundleListenerInterface {
13 * Reacts to a bundle being created.
15 * @param string $bundle
16 * The name of the bundle created.
17 * @param string $entity_type_id
18 * The entity type to which the bundle is bound; e.g. 'node' or 'user'.
20 public function onBundleCreate($bundle, $entity_type_id);
23 * Reacts to a bundle being deleted.
25 * This method runs before fields are deleted.
27 * @param string $bundle
28 * The name of the bundle being deleted.
29 * @param string $entity_type_id
30 * The entity type to which the bundle is bound; e.g. 'node' or 'user'.
32 public function onBundleDelete($bundle, $entity_type_id);