// Replace shop->addSqlRestriction() and shop->addSqlRestrictionOnLang() by static versions

This commit is contained in:
rMalie
2012-02-27 12:15:30 +00:00
parent 6f10f8fb12
commit 0a3fa7ba14
58 changed files with 210 additions and 241 deletions
+3 -3
View File
@@ -97,7 +97,7 @@ class MailAlert extends ObjectModel
$customer = new Customer($id_customer);
$customer_email = $customer->email;
$products = MailAlert::getProducts($customer, $id_lang, $shop);
$products = MailAlert::getProducts($customer, $id_lang);
if ((empty($products) === true) || (!sizeof($products)))
return array();
@@ -195,7 +195,7 @@ class MailAlert extends ObjectModel
/*
* Get products according to alerts
*/
public static function getProducts($customer, $id_lang, Shop $shop)
public static function getProducts($customer, $id_lang)
{
$sql = 'SELECT ma.`id_product`, p.`quantity` AS product_quantity, pl.`name`, ma.`id_product_attribute`
FROM `'._DB_PREFIX_.self::$definition['table'].'` ma
@@ -204,7 +204,7 @@ class MailAlert extends ObjectModel
WHERE p.`active` = 1
AND (ma.`id_customer` = '.(int)$customer->id.'
OR ma.`customer_email` = \''.pSQL($customer->email).'\')
AND pl.`id_lang` = '.(int)$id_lang.$shop->addSqlRestriction(false, 'ma');
AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestriction(false, 'ma');
return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql);
}