Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / Entity / FieldableEntityStorageInterface.php
1 <?php
2
3 namespace Drupal\Core\Entity;
4
5 use Drupal\Core\Field\FieldDefinitionInterface;
6 use Drupal\Core\Field\FieldStorageDefinitionInterface;
7
8 /**
9  * A storage that supports entity types with field definitions.
10  */
11 interface FieldableEntityStorageInterface extends EntityStorageInterface {
12
13   /**
14    * Determines the number of entities with values for a given field.
15    *
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.
21    *
22    * @return bool|int
23    *   The number of entities. If $as_bool parameter is TRUE then the
24    *   value will either be TRUE or FALSE.
25    *
26    * @see \Drupal\Core\Entity\FieldableEntityStorageInterface::purgeFieldData()
27    */
28   public function countFieldData($storage_definition, $as_bool = FALSE);
29
30   /**
31    * Purges a batch of field data.
32    *
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().
39    *
40    * @return int
41    *   The number of field data records that have been purged.
42    */
43   public function purgeFieldData(FieldDefinitionInterface $field_definition, $batch_size);
44
45   /**
46    * Performs final cleanup after all data of a field has been purged.
47    *
48    * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
49    *   The field storage being purged.
50    */
51   public function finalizePurge(FieldStorageDefinitionInterface $storage_definition);
52
53 }