You are here

function feeds_get_feed_nid in Feeds 7.2

Same name and namespace in other branches
  1. 8.2 feeds.module \feeds_get_feed_nid()

Gets the feed_nid for a single entity.

Parameters

int $entity_id: The entity id.

string $entity_type: The type of entity.

Return value

int|bool The feed_nid of the entity, or FALSE if the entity doesn't belong to a feed.

Related topics

1 call to feeds_get_feed_nid()
feeds_tokens in ./feeds.tokens.inc
Implements hook_tokens().

File

./feeds.module, line 663
Feeds - basic API functions and hook implementations.

Code

function feeds_get_feed_nid($entity_id, $entity_type) {
  return db_query("SELECT feed_nid FROM {feeds_item} WHERE entity_type = :type AND entity_id = :id", array(
    ':type' => $entity_type,
    ':id' => $entity_id,
  ))
    ->fetchField();
}