// Performance optimizations

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16024 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-06-14 14:11:11 +00:00
parent 3e46c466a8
commit b2b29c4270
14 changed files with 98 additions and 93 deletions
+10 -10
View File
@@ -93,9 +93,9 @@ class ConfigurationCore extends ObjectModel
*/
public static function getIdByName($key, $id_shop_group = null, $id_shop = null)
{
if (is_null($id_shop))
if ($id_shop === null)
$id_shop = Shop::getContextShopID();
if (is_null($id_shop_group))
if ($id_shop_group === null)
$id_shop_group = Shop::getContextShopGroupID();
$sql = 'SELECT id_configuration
@@ -147,9 +147,9 @@ class ConfigurationCore extends ObjectModel
public static function get($key, $id_lang = null, $id_shop_group = null, $id_shop = null)
{
$id_lang = (int)$id_lang;
if (is_null($id_shop))
if ($id_shop === null)
$id_shop = Shop::getContextShopID();
if (is_null($id_shop_group))
if ($id_shop_group === null)
$id_shop_group = Shop::getContextShopGroupID();
if (!isset(self::$_CONF[$id_lang]))
@@ -203,9 +203,9 @@ class ConfigurationCore extends ObjectModel
throw new PrestaShopException('keys var is not an array');
$id_lang = (int)$id_lang;
if (is_null($id_shop))
if ($id_shop === null)
$id_shop = Shop::getContextShopID();
if (is_null($id_shop_group))
if ($id_shop_group === null)
$id_shop_group = Shop::getContextShopGroupID();
$results = array();
@@ -246,9 +246,9 @@ class ConfigurationCore extends ObjectModel
if (!Validate::isConfigName($key))
die(Tools::displayError());
if (is_null($id_shop))
if ($id_shop === null)
$id_shop = Shop::getContextShopID();
if (is_null($id_shop_group))
if ($id_shop_group === null)
$id_shop_group = Shop::getContextShopGroupID();
if (!is_array($values))
@@ -293,9 +293,9 @@ class ConfigurationCore extends ObjectModel
if (!Validate::isConfigName($key))
die(Tools::displayError());
if (is_null($id_shop))
if ($id_shop === null)
$id_shop = Shop::getContextShopID();
if (is_null($id_shop_group))
if ($id_shop_group === null)
$id_shop_group = Shop::getContextShopGroupID();
if (!is_array($values))