[*] CORE : Remove duplicate SQL queries

This commit is contained in:
gRoussac committed 2013-11-11 13:41:23 +01:00
1 parent de404706d9
commit a7869a1f06
22 files changed
+507 -322

No files matched your search

+7 -1
View File
@@ -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);
}
/**