function _node_mass_update_helper

Updates individual nodes when fewer than 10 are queued.

Parameters

$nid: ID of node to update.

$updates: Associative array of updates.

Return value

object An updated node object.

See also

node_mass_update()

2 calls to _node_mass_update_helper()
node_mass_update in drupal/core/modules/node/node.admin.inc
Updates all nodes in the passed-in array with the passed-in field values.
_node_mass_update_batch_process in drupal/core/modules/node/node.admin.inc
Executes a batch operation for node_mass_update().

File

drupal/core/modules/node/node.admin.inc, line 321
Content administration and module settings user interface.

Code

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