You are here

function filefield_filefield_paths_batch_update in File (Field) Paths 6

Implements hook_filefield_paths_batch_update().

File

modules/filefield.inc, line 77
Provides FileField Paths integration with the FileField module.

Code

function filefield_filefield_paths_batch_update($field, $type, &$objects) {
  $field = content_fields($field, $type);
  $db_info = content_database_info($field);
  $result = db_query("SELECT c.nid FROM {%s} c LEFT JOIN {node} n ON c.nid = n.nid WHERE c.%s IS NOT NULL\n    AND n.type = '%s'", $db_info['table'], $db_info['columns']['fid']['column'], $type);

  // Build array of Node IDs.
  while ($node = db_fetch_object($result)) {
    $objects[] = $node->nid;
  }
}