You are here

function field_attach_presave in Drupal 7

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

5 calls to field_attach_presave()
comment_save in modules/comment/comment.module
Accepts a submission of new or changed comment content.
field_test_entity_save in modules/field/tests/field_test.entity.inc
Saves a test_entity.
node_save in modules/node/node.module
Saves changes to a node or adds a new node.
taxonomy_term_save in modules/taxonomy/taxonomy.module
Saves a term object to the database.
user_save in modules/user/user.module
Save changes to a user account or add a new user.

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);
}