// Remove bad _SQL_USE_SLAVE_ uses + normalize Db->executeS(), Db->execute() and Db->numRows() names

This commit is contained in:
rMalie
2011-10-10 12:18:56 +00:00
parent 149c814a45
commit 9510337b1d
280 changed files with 1971 additions and 1966 deletions
+4 -4
View File
@@ -95,7 +95,7 @@ class HomeSlide extends ObjectModel
$id_shop = $context->shop->getID();
$res = parent::add($autodate, $nullValues);
$res &= Db::getInstance(_PS_USE_SQL_SLAVE_)->Execute('
$res &= Db::getInstance()->execute('
INSERT INTO `'._DB_PREFIX_.'homeslider` (`id_shop`, `id_slide`)
VALUES('.(int)$id_shop.', '.(int)$this->id.')'
);
@@ -113,7 +113,7 @@ class HomeSlide extends ObjectModel
}
$res &= $this->reOrderPositions();
$res &= Db::getInstance(_PS_USE_SQL_SLAVE_)->Execute('
$res &= Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'homeslider`
WHERE `id_slide` = '.(int)$this->id
);
@@ -128,7 +128,7 @@ class HomeSlide extends ObjectModel
$context = Context::getContext();
$id_shop = $context->shop->getID();
$max = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
$max = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT MAX(hss.`position`) as position
FROM `'._DB_PREFIX_.'homeslider_slides` hss, `'._DB_PREFIX_.'homeslider` hs
WHERE hss.`id_slide` = hs.`id_slide` AND hs.`id_shop` = '.(int)$id_shop
@@ -137,7 +137,7 @@ class HomeSlide extends ObjectModel
if ((int)$max == (int)$id_slide)
return true;
$rows = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
$rows = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT hss.`position` as position, hss.`id_slide` as id_slide
FROM `'._DB_PREFIX_.'homeslider_slides` hss, `'._DB_PREFIX_.'homeslider` hs
WHERE hss.`id_slide` = hs.`id_slide` AND hs.`id_shop` = '.(int)$id_shop.' AND hss.`position` > '.(int)$this->position