// 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
@@ -57,15 +57,15 @@ class ProductCommentCriterion extends ObjectModel
if (!parent::delete())
return false;
if ($this->id_product_comment_criterion_type == 2)
if (!Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'product_comment_criterion_category
if (!Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'product_comment_criterion_category
WHERE id_product_comment_criterion='.(int)$this->id))
return false;
elseif ($this->id_product_comment_criterion_type == 3)
if (!Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'product_comment_criterion_product
if (!Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'product_comment_criterion_product
WHERE id_product_comment_criterion='.(int)$this->id))
return false;
return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_comment_grade`
return Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'product_comment_grade`
WHERE `id_product_comment_criterion` = '.(int)$this->id);
}
@@ -77,10 +77,10 @@ class ProductCommentCriterion extends ObjectModel
if ($previousUpdate->id_product_comment_criterion_type != $this->id_product_comment_criterion_type)
{
if ($previousUpdate->id_product_comment_criterion_type == 2)
return Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'product_comment_criterion_category
return Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'product_comment_criterion_category
WHERE id_product_comment_criterion='.(int)$previousUpdate->id);
elseif ($previousUpdate->id_product_comment_criterion_type == 3)
return Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'product_comment_criterion_product
return Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'product_comment_criterion_product
WHERE id_product_comment_criterion='.(int)$previousUpdate->id);
}
return true;
@@ -95,7 +95,7 @@ class ProductCommentCriterion extends ObjectModel
{
if (!Validate::isUnsignedId($id_product))
die(Tools::displayError());
return (Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'product_comment_criterion_product` (`id_product_comment_criterion`, `id_product`)
return (Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'product_comment_criterion_product` (`id_product_comment_criterion`, `id_product`)
VALUES('.(int)$this->id.','.(int)$id_product.')'));
}
@@ -108,7 +108,7 @@ class ProductCommentCriterion extends ObjectModel
{
if (!Validate::isUnsignedId($id_category))
die(Tools::displayError());
return (Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'product_comment_criterion_category` (`id_product_comment_criterion`, `id_category`)
return (Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'product_comment_criterion_category` (`id_product_comment_criterion`, `id_category`)
VALUES('.(int)$this->id.','.(int)$id_category.')'));
}
@@ -125,7 +125,7 @@ class ProductCommentCriterion extends ObjectModel
$grade = 0;
else if ($grade > 10)
$grade = 10;
return (Db::getInstance()->Execute('
return (Db::getInstance()->execute('
INSERT INTO `'._DB_PREFIX_.'product_comment_grade`
(`id_product_comment`, `id_product_comment_criterion`, `grade`) VALUES(
'.(int)($id_product_comment).',
@@ -143,7 +143,7 @@ class ProductCommentCriterion extends ObjectModel
if (!Validate::isUnsignedId($id_product) ||
!Validate::isUnsignedId($id_lang))
die(Tools::displayError());
return Db::getInstance()->ExecuteS('
return Db::getInstance()->executeS('
SELECT pcc.`id_product_comment_criterion`, pccl.`name`
FROM `'._DB_PREFIX_.'product_comment_criterion` pcc
LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_lang` pccl ON (pcc.id_product_comment_criterion = pccl.id_product_comment_criterion)
@@ -163,7 +163,7 @@ class ProductCommentCriterion extends ObjectModel
{
if (!Validate::isUnsignedId($id_lang))
die(Tools::displayError());
return (Db::getInstance()->ExecuteS('
return (Db::getInstance()->executeS('
SELECT pcc.`id_product_comment_criterion`, pcc.id_product_comment_criterion_type, pccl.`name`, pcc.active
FROM `'._DB_PREFIX_.'product_comment_criterion` pcc
JOIN `'._DB_PREFIX_.'product_comment_criterion_lang` pccl ON (pcc.id_product_comment_criterion = pccl.id_product_comment_criterion)
@@ -173,7 +173,7 @@ class ProductCommentCriterion extends ObjectModel
public function getProducts()
{
$res = Db::getInstance()->ExecuteS('
$res = Db::getInstance()->executeS('
SELECT pccp.id_product, pccp.id_product_comment_criterion
FROM `'._DB_PREFIX_.'product_comment_criterion_product` pccp
WHERE pccp.id_product_comment_criterion = '.(int)$this->id);
@@ -186,7 +186,7 @@ class ProductCommentCriterion extends ObjectModel
public function getCategories()
{
$res = Db::getInstance()->ExecuteS('
$res = Db::getInstance()->executeS('
SELECT pccc.id_category, pccc.id_product_comment_criterion
FROM `'._DB_PREFIX_.'product_comment_criterion_category` pccc
WHERE pccc.id_product_comment_criterion = '.(int)$this->id);
@@ -199,12 +199,12 @@ class ProductCommentCriterion extends ObjectModel
public function deleteCategories()
{
return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_comment_criterion_category` WHERE `id_product_comment_criterion` = '.(int)$this->id);
return Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'product_comment_criterion_category` WHERE `id_product_comment_criterion` = '.(int)$this->id);
}
public function deleteProducts()
{
return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_comment_criterion_product` WHERE `id_product_comment_criterion` = '.(int)$this->id);
return Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'product_comment_criterion_product` WHERE `id_product_comment_criterion` = '.(int)$this->id);
}
public static function getTypes()