You are here

function sbp_attach_node_update in Search by Page 7

Implements hook_node_update().

When a node is updated, sets any attached files for reindexing at the next cron run.

File

./sbp_attach.module, line 560
Module file for Search by Page Attachments, a sub-module for Search by Page.

Code

function sbp_attach_node_update($node) {

  // Find the sbp_attach IDs in our database associated with this node ID.
  $res = db_query("SELECT sbpaid FROM {sbpa_attachments} WHERE objtype = 'node' AND objid = :nid", array(
    ':nid' => $node->nid,
  ))
    ->fetchCol();
  foreach ($res as $id) {
    search_by_page_force_reindex('sbp_attach', $id);
  }
}