function _cer_update in Corresponding Entity References 7.2
Same name and namespace in other branches
- 7 cer.crud.inc \_cer_update()
Update field data.
Parameters
$node the referenced node to be updated.:
3 calls to _cer_update()
- CerHandler::delete in ./
handler.inc - Implements CerHandlerInterface::delete().
- CerHandler::insert in ./
handler.inc - Implements CerHandlerInterface::insert().
- CerHandler::update in ./
handler.inc - Implements CerHandlerInterface::update().
File
- ./
cer.module, line 296 - Main module file.
Code
function _cer_update($entity_type, $entity) {
$entity->original = isset($entity->original) ? $entity->original : NULL;
$extract_ids = entity_extract_IDs($entity_type, $entity);
$id = array_shift($extract_ids);
field_attach_presave($entity_type, $entity);
field_attach_update($entity_type, $entity);
// Issue #2212499.
if ($entity_type == 'node') {
$entity->changed = time();
db_update('node')
->fields(array(
'changed' => $entity->changed,
))
->condition('nid', $id)
->execute();
}
entity_get_controller($entity_type)
->resetCache(array(
$id,
));
}