function field_purge_field in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/field/field.purge.inc \field_purge_field()
Purges a field record from the database.
This function assumes all data for the field has already been purged and should only be called by field_purge_batch().
Parameters
$field: The field record to purge.
Related topics
1 call to field_purge_field()
- field_purge_batch in core/
modules/ field/ field.purge.inc - Purges a batch of deleted Field API data, field storages, or fields.
File
- core/
modules/ field/ field.purge.inc, line 140 - Provides support for field data purge after mass deletion.
Code
function field_purge_field(FieldConfigInterface $field) {
$state = \Drupal::state();
$deleted_fields = $state
->get('field.field.deleted');
unset($deleted_fields[$field
->uuid()]);
$state
->set('field.field.deleted', $deleted_fields);
// Invoke external hooks after the cache is cleared for API consistency.
\Drupal::moduleHandler()
->invokeAll('field_purge_field', array(
$field,
));
}