Version 1
[yaffs-website] / web / core / lib / Drupal / Core / Entity / EntityBundleListenerInterface.php
diff --git a/web/core/lib/Drupal/Core/Entity/EntityBundleListenerInterface.php b/web/core/lib/Drupal/Core/Entity/EntityBundleListenerInterface.php
new file mode 100644 (file)
index 0000000..b9cba3b
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+namespace Drupal\Core\Entity;
+
+/**
+ * An interface for reacting to entity bundle creation and deletion.
+ *
+ * @todo Convert to Symfony events: https://www.drupal.org/node/2332935
+ */
+interface EntityBundleListenerInterface {
+
+  /**
+   * Reacts to a bundle being created.
+   *
+   * @param string $bundle
+   *   The name of the bundle created.
+   * @param string $entity_type_id
+   *   The entity type to which the bundle is bound; e.g. 'node' or 'user'.
+   */
+  public function onBundleCreate($bundle, $entity_type_id);
+
+  /**
+   * Reacts to a bundle being deleted.
+   *
+   * This method runs before fields are deleted.
+   *
+   * @param string $bundle
+   *   The name of the bundle being deleted.
+   * @param string $entity_type_id
+   *   The entity type to which the bundle is bound; e.g. 'node' or 'user'.
+   */
+  public function onBundleDelete($bundle, $entity_type_id);
+
+}