You are here

function _feedapi_node_update in FeedAPI 5

Same name and namespace in other branches
  1. 6 feedapi_node/feedapi_node.module \_feedapi_node_update()

Update a node which already assigned to a feed item

File

feedapi_node/feedapi_node.module, line 314
Handle how the feed items are represented as a content Handle the processing of the feed items

Code

function _feedapi_node_update($feed_item, $feed_nid, $settings = array()) {

  // Determine which node is assigned to this item
  if ($feed_item->options->guid) {
    $node = db_fetch_object(db_query("SELECT nid FROM {feedapi_node_item} WHERE guid = '%s'", $feed_item->options->guid));
  }
  else {
    $node = db_fetch_object(db_query("SELECT nid FROM {feedapi_node_item} WHERE url = '%s'", $feed_item->options->original_url));
  }
  $feed_item->nid = $node->nid;
  _feedapi_node_save($feed_item, $feed_nid, $settings);
  return $feed_item;
}