[*] CORE : Remove duplicate SQL queries

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

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);
}
/**