EntityBundleListenerInterface.php 883 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Drupal\Core\Entity;
  3. /**
  4. * An interface for reacting to entity bundle creation and deletion.
  5. *
  6. * @todo Convert to Symfony events: https://www.drupal.org/node/2332935
  7. */
  8. interface EntityBundleListenerInterface {
  9. /**
  10. * Reacts to a bundle being created.
  11. *
  12. * @param string $bundle
  13. * The name of the bundle created.
  14. * @param string $entity_type_id
  15. * The entity type to which the bundle is bound; e.g. 'node' or 'user'.
  16. */
  17. public function onBundleCreate($bundle, $entity_type_id);
  18. /**
  19. * Reacts to a bundle being deleted.
  20. *
  21. * This method runs before fields are deleted.
  22. *
  23. * @param string $bundle
  24. * The name of the bundle being deleted.
  25. * @param string $entity_type_id
  26. * The entity type to which the bundle is bound; e.g. 'node' or 'user'.
  27. */
  28. public function onBundleDelete($bundle, $entity_type_id);
  29. }