You are here

interface FieldDefinitionListenerInterface in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Field/FieldDefinitionListenerInterface.php \Drupal\Core\Field\FieldDefinitionListenerInterface

Defines an interface for reacting to field creation, deletion, and updates.

Hierarchy

Expanded class hierarchy of FieldDefinitionListenerInterface

All classes that implement FieldDefinitionListenerInterface

2 files declare their use of FieldDefinitionListenerInterface
DynamicallyFieldableEntityStorageInterface.php in core/lib/Drupal/Core/Entity/DynamicallyFieldableEntityStorageInterface.php
EntityManagerInterface.php in core/lib/Drupal/Core/Entity/EntityManagerInterface.php

File

core/lib/Drupal/Core/Field/FieldDefinitionListenerInterface.php, line 8

Namespace

Drupal\Core\Field
View source
interface FieldDefinitionListenerInterface {

  /**
   * Reacts to the creation of a field.
   *
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
   *   The field definition created.
   */
  public function onFieldDefinitionCreate(FieldDefinitionInterface $field_definition);

  /**
   * Reacts to the update of a field.
   *
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
   *   The field definition being updated.
   * @param \Drupal\Core\Field\FieldDefinitionInterface $original
   *   The original field definition; i.e., the definition before the update.
   */
  public function onFieldDefinitionUpdate(FieldDefinitionInterface $field_definition, FieldDefinitionInterface $original);

  /**
   * 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.
   *
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
   *   The field definition being deleted.
   */
  public function onFieldDefinitionDelete(FieldDefinitionInterface $field_definition);

}

Members

Namesort descending Modifiers Type Description Overrides
FieldDefinitionListenerInterface::onFieldDefinitionCreate public function Reacts to the creation of a field. 3
FieldDefinitionListenerInterface::onFieldDefinitionDelete public function Reacts to the deletion of a field. 3
FieldDefinitionListenerInterface::onFieldDefinitionUpdate public function Reacts to the update of a field. 3