You are here

function _cer_update in Corresponding Entity References 7

Same name and namespace in other branches
  1. 7.2 cer.module \_cer_update()

Update field data.

Parameters

$node the referenced node to be updated.:

3 calls to _cer_update()
cer_delete in ./cer.crud.inc
$keys = array( 'home_entity_type' => $key[0], 'home_bundle' => $key[1], 'home_field' => $key[2], 'away_entity_type' => $key[3], 'away_bundle' => $key[4], 'away_field' =>…
cer_insert in ./cer.crud.inc
Add any corresponding references on node insertion.
cer_update in ./cer.crud.inc
$keys = array( 'home_entity_type' => $key[0], 'home_bundle' => $key[1], 'home_field' => $key[2], 'away_entity_type' => $key[3], 'away_bundle' => $key[4], 'away_field' =>…

File

./cer.crud.inc, line 292
Include file providing corresponding node reference insert, update, and delete handling.

Code

function _cer_update($entity_type, $entity) {
  $entity->original = isset($entity->original) ? $entity->original : NULL;
  field_attach_presave($entity_type, $entity);
  field_attach_update($entity_type, $entity);
  list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
  entity_get_controller($entity_type)
    ->resetCache(array(
    $id,
  ));
}