interface FieldableEntityStorageInterface

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Entity/FieldableEntityStorageInterface.php \Drupal\Core\Entity\FieldableEntityStorageInterface
  2. 10 core/lib/Drupal/Core/Entity/FieldableEntityStorageInterface.php \Drupal\Core\Entity\FieldableEntityStorageInterface
  3. 8.9.x core/lib/Drupal/Core/Entity/FieldableEntityStorageInterface.php \Drupal\Core\Entity\FieldableEntityStorageInterface

A storage that supports entity types with field definitions.

Hierarchy

Expanded class hierarchy of FieldableEntityStorageInterface

All classes that implement FieldableEntityStorageInterface

3 files declare their use of FieldableEntityStorageInterface
FieldConfig.php in core/modules/field/src/Entity/FieldConfig.php
FieldStorageConfig.php in core/modules/field/src/Entity/FieldStorageConfig.php
FieldStorageDefinitionListener.php in core/lib/Drupal/Core/Field/FieldStorageDefinitionListener.php

File

core/lib/Drupal/Core/Entity/FieldableEntityStorageInterface.php, line 11

Namespace

Drupal\Core\Entity
View source
interface FieldableEntityStorageInterface extends EntityStorageInterface {
  
  /**
   * Determines the number of entities with values for a given field.
   *
   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
   *   The field for which to count data records.
   * @param bool $as_bool
   *   (Optional) Optimizes the query for checking whether there are any records
   *   or not. Defaults to FALSE.
   *
   * @return bool|int
   *   The number of entities. If $as_bool parameter is TRUE then the
   *   value will either be TRUE or FALSE.
   *
   * @see \Drupal\Core\Entity\FieldableEntityStorageInterface::purgeFieldData()
   */
  public function countFieldData($storage_definition, $as_bool = FALSE);
  
  /**
   * Purges a batch of field data.
   *
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
   *   The deleted field whose data is being purged.
   * @param int $batch_size
   *   The maximum number of field data records to purge before returning,
   *   relating to the count of field data records returned by
   *   \Drupal\Core\Entity\FieldableEntityStorageInterface::countFieldData().
   *
   * @return int
   *   The number of field data records that have been purged.
   */
  public function purgeFieldData(FieldDefinitionInterface $field_definition, $batch_size);
  
  /**
   * Performs final cleanup after all data of a field has been purged.
   *
   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
   *   The field storage being purged.
   */
  public function finalizePurge(FieldStorageDefinitionInterface $storage_definition);

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.