3 namespace Drupal\Core\Entity;
5 use Drupal\Core\Field\FieldDefinitionInterface;
6 use Drupal\Core\Field\FieldStorageDefinitionInterface;
9 * A storage that supports entity types with field definitions.
11 interface FieldableEntityStorageInterface extends EntityStorageInterface {
14 * Determines the number of entities with values for a given field.
16 * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
17 * The field for which to count data records.
18 * @param bool $as_bool
19 * (Optional) Optimises the query for checking whether there are any records
20 * or not. Defaults to FALSE.
23 * The number of entities. If $as_bool parameter is TRUE then the
24 * value will either be TRUE or FALSE.
26 * @see \Drupal\Core\Entity\FieldableEntityStorageInterface::purgeFieldData()
28 public function countFieldData($storage_definition, $as_bool = FALSE);
31 * Purges a batch of field data.
33 * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
34 * The deleted field whose data is being purged.
35 * @param int $batch_size
36 * The maximum number of field data records to purge before returning,
37 * relating to the count of field data records returned by
38 * \Drupal\Core\Entity\FieldableEntityStorageInterface::countFieldData().
41 * The number of field data records that have been purged.
43 public function purgeFieldData(FieldDefinitionInterface $field_definition, $batch_size);
46 * Performs final cleanup after all data of a field has been purged.
48 * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
49 * The field storage being purged.
51 public function finalizePurge(FieldStorageDefinitionInterface $storage_definition);