EntityBundleListenerInterface.php 808 Bytes
Newer Older
1
2
3
4
5
<?php

namespace Drupal\Core\Entity;

/**
6
 * An interface for reacting to entity bundle creation and deletion.
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 */
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);

}