// Performance optimizations

This commit is contained in:
rGaillard
2012-06-14 14:11:11 +00:00
parent 2609f8ff7e
commit 066ce42382
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))