function elysia_cron_get in Elysia Cron 7.2
Same name and namespace in other branches
- 5.2 elysia_cron.module \elysia_cron_get()
- 5 elysia_cron.module \elysia_cron_get()
- 6.2 elysia_cron.module \elysia_cron_get()
- 6 elysia_cron.module \elysia_cron_get()
- 7 elysia_cron.module \elysia_cron_get()
15 calls to elysia_cron_get()
- elysia_cron_get_channel_abort_count in ./
elysia_cron.module - Get channel's about count.
- elysia_cron_get_channel_last_aborted in ./
elysia_cron.module - Get channel's last aborted value.
- elysia_cron_get_channel_last_abort_function in ./
elysia_cron.module - Get channel's last about function.
- elysia_cron_get_channel_last_run in ./
elysia_cron.module - Get channel's last run value.
- elysia_cron_get_channel_rule in ./
elysia_cron.module - Get channel's rule.
File
- ./
elysia_cron.module, line 353
Code
function elysia_cron_get($name, $channel = FALSE, $key = FALSE, $default = FALSE, $refresh = FALSE) {
global $_elysia_cron_db_cache;
static $elysia_cron_defaults;
if (!isset($elysia_cron_defaults)) {
$elysia_cron_defaults = function_exists('elysia_cron_get_ctools_defaults') ? elysia_cron_get_ctools_defaults() : array();
}
if ($channel) {
$name = ':' . $name;
}
if ($refresh || !isset($_elysia_cron_db_cache[$name])) {
$_elysia_cron_db_cache[$name] = db_select('elysia_cron', 'ec')
->fields('ec', _elysia_cron_columns())
->condition('name', $name)
->execute()
->fetchAssoc();
if (!$_elysia_cron_db_cache[$name] && isset($elysia_cron_defaults[$name])) {
$_elysia_cron_db_cache[$name] = (array) $elysia_cron_defaults[$name];
}
elseif ($_elysia_cron_db_cache[$name] && isset($elysia_cron_defaults[$name])) {
foreach ($elysia_cron_defaults[$name] as $k => $v) {
if (!isset($_elysia_cron_db_cache[$name][$k]) || is_null($_elysia_cron_db_cache[$name][$k])) {
$_elysia_cron_db_cache[$name][$k] = $v;
}
}
}
}
return !$_elysia_cron_db_cache[$name] || !isset($_elysia_cron_db_cache[$name][$key]) || is_null($_elysia_cron_db_cache[$name][$key]) ? $default : $_elysia_cron_db_cache[$name][$key];
}