Updates individual nodes when fewer than 10 are queued.
$nid: ID of node to update.
$updates: Associative array of updates.
object An updated node object.
function _node_mass_update_helper($nid, $updates) {
$node = node_load($nid, TRUE);
// For efficiency manually save the original node before applying any changes.
$node->original = clone $node;
foreach ($updates as $name => $value) {
$node->{$name} = $value;
}
$node
->save();
return $node;
}