function field_attach_presave

Performs necessary operations just before fields data get saved.

We take no specific action here, we just give other modules the opportunity to act.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity with fields to process.

Related topics

1 call to field_attach_presave()
_translation_entity_update_field in drupal/core/modules/translation_entity/translation_entity.admin.inc
Stores the given field translations.

File

drupal/core/modules/field/field.attach.inc, line 1162
Field attach API, allowing entities (nodes, users, ...) to be 'fieldable'.

Code

function field_attach_presave($entity) {

  // Ensure we are working with a BC mode entity.
  $entity = $entity
    ->getBCEntity();
  _field_invoke('presave', $entity);

  // Let other modules act on presaving the entity.
  module_invoke_all('field_attach_presave', $entity);
}