// same for unregister hook

This commit is contained in:
Rémi Gaillard
2013-07-01 16:30:53 +02:00
parent 09359d011f
commit c5fc26ed0b
5 changed files with 44 additions and 2 deletions
+16
View File
@@ -128,6 +128,22 @@ class HookCore extends ObjectModel
return Cache::retrieve($cache_id);
}
/**
* Return hook ID from name
*/
public static function getNameById($hook_id)
{
$cache_id = 'hook_namebyid_'.$hook_id;
if (!Cache::isStored($cache_id))
Cache::store($cache_id, Db::getInstance()->getValue('
SELECT `name`
FROM `'._DB_PREFIX_.'hook`
WHERE `id_hook` = '.(int)$hook_id)
);
return Cache::retrieve($cache_id);
}
/**
* Get list of hook alias
*