Drupal 8  8.0.2
FieldDefinitionListener Class Reference
Inheritance diagram for FieldDefinitionListener:

Public Member Functions

 __construct (EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, KeyValueFactoryInterface $key_value_factory, CacheBackendInterface $cache_backend)
 
 onFieldDefinitionCreate (FieldDefinitionInterface $field_definition)
 
 onFieldDefinitionUpdate (FieldDefinitionInterface $field_definition, FieldDefinitionInterface $original)
 
 onFieldDefinitionDelete (FieldDefinitionInterface $field_definition)
 

Protected Attributes

 $entityTypeManager
 
 $keyValueFactory
 
 $cacheBackend
 
 $entityFieldManager
 

Detailed Description

Reacts to field definition CRUD on behalf of the Entity system.

Constructor & Destructor Documentation

__construct ( EntityTypeManagerInterface  $entity_type_manager,
EntityFieldManagerInterface  $entity_field_manager,
KeyValueFactoryInterface  $key_value_factory,
CacheBackendInterface  $cache_backend 
)

Constructs a new FieldDefinitionListener.

Parameters
\Drupal\Core\Entity\EntityTypeManagerInterface$entity_type_managerThe entity type manager.
\Drupal\Core\Entity\EntityFieldManagerInterface$entity_field_managerThe entity field manager.
\Drupal\Core\KeyValueStore\KeyValueFactoryInterface$key_value_factoryThe key-value factory.
\Drupal\Core\Cache\CacheBackendInterface$cache_backendThe cache backend.

References Drupal\entityTypeManager().

Here is the call graph for this function:

Member Function Documentation

onFieldDefinitionCreate ( FieldDefinitionInterface  $field_definition)

{Reacts to the creation of a field.

Parameters
\Drupal\Core\Field\FieldDefinitionInterface$field_definitionThe field definition created.
}

Implements FieldDefinitionListenerInterface.

References Drupal\entityTypeManager(), FieldDefinitionInterface\getName(), FieldDefinitionInterface\getTargetBundle(), FieldDefinitionInterface\getTargetEntityTypeId(), and FieldDefinitionInterface\getType().

Here is the call graph for this function:

onFieldDefinitionDelete ( FieldDefinitionInterface  $field_definition)

{Reacts to the deletion of a field.Stored values should not be wiped at once, but marked as 'deleted' so that they can go through a proper purge process later on.

Parameters
\Drupal\Core\Field\FieldDefinitionInterface$field_definitionThe field definition being deleted.
}

Implements FieldDefinitionListenerInterface.

References Drupal\entityTypeManager(), FieldDefinitionInterface\getName(), FieldDefinitionInterface\getTargetBundle(), and FieldDefinitionInterface\getTargetEntityTypeId().

Here is the call graph for this function:

onFieldDefinitionUpdate ( FieldDefinitionInterface  $field_definition,
FieldDefinitionInterface  $original 
)

{Reacts to the update of a field.

Parameters
\Drupal\Core\Field\FieldDefinitionInterface$field_definitionThe field definition being updated.
\Drupal\Core\Field\FieldDefinitionInterface$originalThe original field definition; i.e., the definition before the update.
}

Implements FieldDefinitionListenerInterface.

References Drupal\entityTypeManager(), and FieldDefinitionInterface\getTargetEntityTypeId().

Here is the call graph for this function:


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