04d1b1e05c8fdc9caad05fc82070d498750aad7c
[yaffs-website] / web / core / lib / Drupal / Core / Entity / DynamicallyFieldableEntityStorageInterface.php
1 <?php
2
3 namespace Drupal\Core\Entity;
4
5 use Drupal\Core\Field\FieldDefinitionInterface;
6 use Drupal\Core\Field\FieldDefinitionListenerInterface;
7 use Drupal\Core\Field\FieldStorageDefinitionInterface;
8 use Drupal\Core\Field\FieldStorageDefinitionListenerInterface;
9
10 /**
11  * A storage that supports entity types with dynamic field definitions.
12  *
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.
16  *
17  * For example, configurable fields defined and exposed by field.module.
18  */
19 interface DynamicallyFieldableEntityStorageInterface extends FieldableEntityStorageInterface, FieldStorageDefinitionListenerInterface, FieldDefinitionListenerInterface {
20
21   /**
22    * Purges a batch of field data.
23    *
24    * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
25    *   The deleted field whose data is being purged.
26    * @param $batch_size
27    *   The maximum number of field data records to purge before returning,
28    *   relating to the count of field data records returned by
29    *   \Drupal\Core\Entity\FieldableEntityStorageInterface::countFieldData().
30    *
31    * @return int
32    *   The number of field data records that have been purged.
33    */
34   public function purgeFieldData(FieldDefinitionInterface $field_definition, $batch_size);
35
36   /**
37    * Performs final cleanup after all data of a field has been purged.
38    *
39    * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
40    *   The field being purged.
41    */
42   public function finalizePurge(FieldStorageDefinitionInterface $storage_definition);
43
44 }