function field_attach_presave

field_attach_presave($entity_type, $entity)

Perform necessary operations just before fields data get saved.

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

Parameters

$entity_type: The type of $entity; e.g. 'node' or 'user'.

$entity: The entity with fields to process.

Related topics

File

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

Code

function field_attach_presave($entity_type, $entity) {
  _field_invoke('presave', $entity_type, $entity);

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!field!field.attach.inc/function/field_attach_presave/7.x