[*] Classes : Db::autoExecute() call are now replaced by Db::insert() or Db::update()

This commit is contained in:
rMalie
2012-01-23 17:41:02 +00:00
parent 08c7b79a27
commit cc841b6969
29 changed files with 251 additions and 235 deletions
+3 -3
View File
@@ -99,8 +99,8 @@ class ShopUrlCore extends ObjectModel
public function setMain()
{
$res = Db::getInstance()->autoExecute(_DB_PREFIX_.'shop_url', array('main' => 0), 'UPDATE', 'id_shop = '.(int)$this->id_shop);
$res &= Db::getInstance()->autoExecute(_DB_PREFIX_.'shop_url', array('main' => 1), 'UPDATE', 'id_shop_url = '.(int)$this->id);
$res = Db::getInstance()->update('shop_url', array('main' => 0), 'id_shop = '.(int)$this->id_shop);
$res &= Db::getInstance()->update('shop_url', array('main' => 1), 'id_shop_url = '.(int)$this->id);
$this->main = true;
// Reset main URL for all shops to prevent problems
@@ -112,7 +112,7 @@ class ShopUrlCore extends ObjectModel
) = 0
GROUP BY s1.id_shop';
foreach (Db::getInstance()->executeS($sql) as $row)
Db::getInstance()->autoExecute(_DB_PREFIX_.'shop_url', array('main' => 1), 'UPDATE', 'id_shop_url = '.$row['id_shop_url']);
Db::getInstance()->update('shop_url', array('main' => 1), 'id_shop_url = '.$row['id_shop_url']);
return $res;
}