Drupal 8  8.0.2
EntityBundleListener Class Reference
Inheritance diagram for EntityBundleListener:

Public Member Functions

 __construct (EntityTypeManagerInterface $entity_type_manager, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityFieldManagerInterface $entity_field_manager, ModuleHandlerInterface $module_handler)
 
 onBundleCreate ($bundle, $entity_type_id)
 
 onBundleDelete ($bundle, $entity_type_id)
 

Protected Attributes

 $entityTypeManager
 
 $entityTypeBundleInfo
 
 $entityFieldManager
 
 $moduleHandler
 

Detailed Description

Reacts to entity bundle CRUD on behalf of the Entity system.

Constructor & Destructor Documentation

__construct ( EntityTypeManagerInterface  $entity_type_manager,
EntityTypeBundleInfoInterface  $entity_type_bundle_info,
EntityFieldManagerInterface  $entity_field_manager,
ModuleHandlerInterface  $module_handler 
)

Constructs a new EntityBundleListener.

Parameters
\Drupal\Core\Entity\EntityTypeManagerInterface$entity_type_managerThe entity type manager.
\Drupal\Core\Entity\EntityTypeBundleInfoInterface$entity_type_bundle_infoThe entity type bundle info.
\Drupal\Core\Entity\EntityFieldManagerInterface$entity_field_managerThe entity field manager.
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerThe module handler.

References Drupal\entityTypeManager(), and Drupal\moduleHandler().

Here is the call graph for this function:

Member Function Documentation

onBundleCreate (   $bundle,
  $entity_type_id 
)

{Reacts to a bundle being created.

Parameters
string$bundleThe name of the bundle created.
string$entity_type_idThe entity type to which the bundle is bound; e.g. 'node' or 'user'.
}

Implements EntityBundleListenerInterface.

References Drupal\entityTypeManager(), and Drupal\moduleHandler().

Here is the call graph for this function:

onBundleDelete (   $bundle,
  $entity_type_id 
)

{Reacts to a bundle being deleted.This method runs before fields are deleted.

Parameters
string$bundleThe name of the bundle being deleted.
string$entity_type_idThe entity type to which the bundle is bound; e.g. 'node' or 'user'.
}

Implements EntityBundleListenerInterface.

References Drupal\entityTypeManager(), and Drupal\moduleHandler().

Here is the call graph for this function:


The documentation for this class was generated from the following file: