- } elseif (intval($param) > 0) {
- $user = dba::select('user', array('uid', 'username', 'expire'), array('uid' => $param), array('limit' => 1));
- if (DBM::is_result($user)) {
- logger('Expire items for user '.$user['uid'].' ('.$user['username'].') - interval: '.$user['expire'], LOGGER_DEBUG);
- item_expire($user['uid'], $user['expire']);
- logger('Expire items for user '.$user['uid'].' ('.$user['username'].') - done ', LOGGER_DEBUG);
- }
- return;
- } elseif (!empty($hook_name) && ($param == 'hook') && is_array($a->hooks) && array_key_exists("expire", $a->hooks)) {
- foreach ($a->hooks["expire"] as $hook) {
- if ($hook[1] == $hook_name) {
- logger("Calling expire hook '" . $hook[1] . "'", LOGGER_DEBUG);
- call_single_hook($a, $name, $hook, $data);
+ } elseif ($param == 'hook' && !empty($hook_function)) {
+ foreach (Hook::getByName('expire') as $hook) {
+ if ($hook[1] == $hook_function) {
+ Logger::info('Calling expire hook', ['hook' => $hook[1]]);
+ Hook::callSingle($a, 'expire', $hook, $data);