static function gallery_config_gateway::get_by in Node Gallery 6
10 calls to gallery_config_gateway::get_by()
- Gallery::get_config in ./
node_gallery.model.inc - node_gallery_config_load in ./
node_gallery.module - node_gallery_gallery_load in ./
node_gallery.module - node_gallery_link_alter in ./
node_gallery.module - Implementation of hook_link_alter().
- node_gallery_list in ./
node_gallery.pages.inc - @file Node gallery pages.
File
- ./
node_gallery.model.inc, line 18 - Node gallery module.
Class
Code
static function get_by($type, $op = 'type') {
static $types;
if (empty($types[$type])) {
if ($op == 'id' && is_numeric($type)) {
$type = db_result(db_query("SELECT type FROM {node} WHERE nid = %d", $type));
}
$result = db_query("SELECT * FROM {ng_gallery_config} gt WHERE gt.gallery_type = '%s'", $type);
$t = drupal_unpack(db_fetch_object($result));
if (!empty($t)) {
$types[$type] = new gallery_config($t);
}
}
return $types[$type];
}