field_attach_presave

Versions
7
field_attach_presave($obj_type, $object)

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

$obj_type The type of $object; e.g. 'node' or 'user'.

$object The object with fields to process.

Related topics

▾ 5 functions call 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
Save changes to a node or add a new node.
taxonomy_term_save in modules/taxonomy/taxonomy.module
Save a term object to the database.
user_save in modules/user/user.module
Save changes to a user account or add a new user.

Code

modules/field/field.attach.inc, line 791

<?php
function field_attach_presave($obj_type, $object) {
  _field_invoke('presave', $obj_type, $object);

  // Let other modules act on presaving the object.
  module_invoke_all('field_attach_presave', $obj_type, $object);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.