You are here

function node_gallery_api_get_cover_nid in Node Gallery 7

Given a gallery, returns it's cover image.

Parameters

int $ngid: A populated node object.

Return value

int The nid of the cover image.

4 calls to node_gallery_api_get_cover_nid()
NodeGalleryBehaviorHandler::NodeGalleryRelationshipCrud in plugins/entityreference/behavior/NodeGalleryBehaviorHandler.class.php
Create, update or delete Node Gallery relationships based on field values.
node_gallery_api_node_insert in ./node_gallery_api.module
Implements hook_node_insert().
node_gallery_api_node_update in ./node_gallery_api.module
Implements hook_node_update().
node_gallery_api_rules_gallery_set_cover in ./node_gallery_api.rules.inc
Rules action for setting the cover item of a gallery.

File

./node_gallery_api.inc, line 844
Node Gallery API function

Code

function node_gallery_api_get_cover_nid($ngid) {
  return db_query("SELECT cover_item FROM {node_gallery_galleries} WHERE ngid = :ngid", array(
    ':ngid' => $ngid,
  ))
    ->fetchField();
}