3 namespace Drupal\Core\Entity;
5 use Drupal\Core\Field\FieldDefinitionInterface;
6 use Drupal\Core\Field\FieldDefinitionListenerInterface;
7 use Drupal\Core\Field\FieldStorageDefinitionInterface;
8 use Drupal\Core\Field\FieldStorageDefinitionListenerInterface;
11 * A storage that supports entity types with dynamic field definitions.
13 * A storage that implements this interface can react to the entity type's field
14 * definitions changing, due to modules being installed or uninstalled, or via
15 * field UI, or via code changes to the entity class.
17 * For example, configurable fields defined and exposed by field.module.
19 interface DynamicallyFieldableEntityStorageInterface extends FieldableEntityStorageInterface, FieldStorageDefinitionListenerInterface, FieldDefinitionListenerInterface {
22 * Determines if the storage contains any data.
25 * TRUE if the storage contains data, FALSE if not.
27 public function hasData();
30 * Purges a batch of field data.
32 * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
33 * The deleted field whose data is being purged.
35 * The maximum number of field data records to purge before returning,
36 * relating to the count of field data records returned by
37 * \Drupal\Core\Entity\FieldableEntityStorageInterface::countFieldData().
40 * The number of field data records that have been purged.
42 public function purgeFieldData(FieldDefinitionInterface $field_definition, $batch_size);
45 * Performs final cleanup after all data of a field has been purged.
47 * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
48 * The field being purged.
50 public function finalizePurge(FieldStorageDefinitionInterface $storage_definition);