Same name and namespace in other branches
  1. 8.x-1.x exif.drush.inc \__drush_exif_node_update() 1 comment
  2. 8.x-2.x exif.drush.inc \__drush_exif_node_update() 1 comment

Parameters

string $type:

Return value

int

1 call to __drush_exif_node_update()
drush_exif_update in ./exif.drush.inc
Drush callback.

File

./exif.drush.inc, line 106

Code

function __drush_exif_node_update($type) {
    $result = db_query("SELECT n.nid FROM {node} n WHERE n.type = :type", 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;
}