EntityBundleListenerInterface.php

Same filename in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityBundleListenerInterface.php
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityBundleListenerInterface.php
  3. 11.x core/lib/Drupal/Core/Entity/EntityBundleListenerInterface.php

Namespace

Drupal\Core\Entity

File

core/lib/Drupal/Core/Entity/EntityBundleListenerInterface.php

View source
<?php

namespace Drupal\Core\Entity;


/**
 * An interface for reacting to entity bundle creation and deletion.
 */
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);

}

Interfaces

Title Deprecated Summary
EntityBundleListenerInterface An interface for reacting to entity bundle creation and deletion.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.