function field_purge_batch

Same name and namespace in other branches
  1. 11.x core/modules/field/field.purge.inc \field_purge_batch()
  2. 10 core/modules/field/field.purge.inc \field_purge_batch()
  3. 9 core/modules/field/field.purge.inc \field_purge_batch()
  4. 8.9.x core/modules/field/field.purge.inc \field_purge_batch()
  5. 7.x modules/field/field.crud.inc \field_purge_batch()

Purges a batch of deleted Field API data, field storages, or fields.

This function will purge deleted field data in batches. The batch size is defined as an argument to the function, and once each batch is finished, it continues with the next batch until all have completed. If a deleted field with no remaining data records is found, the field itself will be purged. If a deleted field storage with no remaining fields is found, the field storage itself will be purged.

Parameters

int $batch_size: The maximum number of field data records to purge before returning.

string $field_storage_unique_id: (optional) Limit the purge to a specific field storage. Defaults to NULL.

Deprecated

in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal\Core\Field\FieldPurger::purgeBatch() instead.

See also

https://www.drupal.org/node/3494023

File

core/modules/field/field.purge.inc, line 32

Code

function field_purge_batch($batch_size, $field_storage_unique_id = NULL) : void {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use \\Drupal\\Core\\Field\\FieldPurger::purgeBatch() instead. See https://www.drupal.org/node/3494023', E_USER_DEPRECATED);
  \Drupal::service(FieldPurger::class)->purgeBatch($batch_size, $field_storage_unique_id);
}

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