You are here

function __drush_exif_node_update in Exif 7

Same name and namespace in other branches
  1. 8.2 exif.drush.inc \__drush_exif_node_update()
  2. 8 exif.drush.inc \__drush_exif_node_update()
1 call to __drush_exif_node_update()
drush_exif_update in ./exif.drush.inc
Drush callback;

File

./exif.drush.inc, line 81

Code

function __drush_exif_node_update($type = '') {
  $query = "SELECT n.nid FROM {node} n WHERE n.type = :type";
  $result = db_query($query, array(
    ':type' => $type,
  ));
  $count = 0;
  foreach ($result as $record) {

    // Load the node object from the database
    $node = node_load($record->nid);

    // Resave the node to make exif changes.
    node_save($node);
    $count++;
  }
  drush_log(dt('Updated %count %type nodes.', array(
    '%count' => $count,
    '%type' => $type,
  )), "ok");
  return $count;
}