3 namespace Drupal\Core\Field;
6 * Defines an interface for reacting to field creation, deletion, and updates.
8 interface FieldDefinitionListenerInterface {
11 * Reacts to the creation of a field.
13 * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
14 * The field definition created.
16 public function onFieldDefinitionCreate(FieldDefinitionInterface $field_definition);
19 * Reacts to the update of a field.
21 * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
22 * The field definition being updated.
23 * @param \Drupal\Core\Field\FieldDefinitionInterface $original
24 * The original field definition; i.e., the definition before the update.
26 public function onFieldDefinitionUpdate(FieldDefinitionInterface $field_definition, FieldDefinitionInterface $original);
29 * Reacts to the deletion of a field.
31 * Stored values should not be wiped at once, but marked as 'deleted' so that
32 * they can go through a proper purge process later on.
34 * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
35 * The field definition being deleted.
37 public function onFieldDefinitionDelete(FieldDefinitionInterface $field_definition);