[*] CORE : Remove duplicate SQL queries
This commit is contained in:
@@ -1864,7 +1864,13 @@ abstract class ModuleCore
|
||||
*/
|
||||
public static function getModuleIdByName($name)
|
||||
{
|
||||
return Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = "'.pSQL($name).'"');
|
||||
$cache_id = __CLASS__.__FUNCTION__.pSQL($name);
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (int)Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = "'.pSQL($name).'"');
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user