function _rate_expiration_get_node_values in Rate 7
Same name and namespace in other branches
- 6.2 expiration/rate_expiration.module \_rate_expiration_get_node_values()
Get configuration for a widgets on a given node.
2 calls to _rate_expiration_get_node_values()
- rate_expiration_form_alter in expiration/
rate_expiration.module - Implements hook_form_alter().
- rate_expiration_rate_widget_alter in expiration/
rate_expiration.module - Implements hook_rate_widget_alter().
File
- expiration/
rate_expiration.module, line 100
Code
function _rate_expiration_get_node_values($nid) {
static $cache = array();
if (isset($cache[$nid])) {
return $cache[$nid];
}
$output = array();
$sql = 'SELECT re.widget_name, re.start, re.end
FROM {rate_expiration} re
WHERE nid = :nid';
$result = db_query($sql, array(
':nid' => $nid,
));
foreach ($result as $record) {
$output[$record->widget_name] = $record;
}
$cache[$nid] = $output;
return $output;
}