[*] Classes : Db::autoExecute() call are now replaced by Db::insert() or Db::update()
This commit is contained in:
@@ -89,35 +89,35 @@ class BlockCms extends Module
|
||||
return false;
|
||||
|
||||
// Install fixtures for blockcms
|
||||
if (!Db::getInstance()->autoExecute(_DB_PREFIX_.'cms_block', array(
|
||||
if (!Db::getInstance()->insert('cms_block', array(
|
||||
'id_cms_category' => 1,
|
||||
'location' => 0,
|
||||
'position' => 0,
|
||||
), 'INSERT'))
|
||||
)))
|
||||
return false;
|
||||
$id_cms_block = Db::getInstance()->Insert_ID();
|
||||
$result = true;
|
||||
$shops = Shop::getShops(true, null, true);
|
||||
foreach ($shops as $shop)
|
||||
$result &= Db::getInstance()->autoExecute(_DB_PREFIX_.'cms_block_shop', array(
|
||||
$result &= Db::getInstance()->insert('cms_block_shop', array(
|
||||
'id_cms_block' => $id_cms_block,
|
||||
'id_shop' => $shop
|
||||
), 'INSERT');
|
||||
));
|
||||
|
||||
|
||||
foreach (Language::getLanguages(false) as $lang)
|
||||
$result &= Db::getInstance()->autoExecute(_DB_PREFIX_.'cms_block_lang', array(
|
||||
$result &= Db::getInstance()->insert('cms_block_lang', array(
|
||||
'id_cms_block' => $id_cms_block,
|
||||
'id_lang' => $lang['id_lang'],
|
||||
'name' => $this->l('Information'),
|
||||
), 'INSERT');
|
||||
));
|
||||
|
||||
foreach (CMS::getCMSPages(null, 1) as $cms)
|
||||
$result &= Db::getInstance()->autoExecute(_DB_PREFIX_.'cms_block_page', array(
|
||||
$result &= Db::getInstance()->insert('cms_block_page', array(
|
||||
'id_cms_block' => $id_cms_block,
|
||||
'id_cms' => $cms['id_cms'],
|
||||
'is_category' => 0,
|
||||
), 'INSERT');
|
||||
));
|
||||
|
||||
return $result;
|
||||
}
|
||||
@@ -740,10 +740,10 @@ class BlockCms extends Module
|
||||
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'cms_block_shop WHERE id_cms_block='.(int)$id_cms_block);
|
||||
foreach ($assos_shop as $asso)
|
||||
foreach ($asso as $id_shop => $row)
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'cms_block_shop', array(
|
||||
Db::getInstance()->insert('cms_block_shop', array(
|
||||
'id_cms_block' => (int)$id_cms_block,
|
||||
'id_shop' => (int)$id_shop,
|
||||
), 'INSERT');
|
||||
));
|
||||
}
|
||||
|
||||
$cmsBoxes = Tools::getValue('cmsBox');
|
||||
|
||||
@@ -188,10 +188,10 @@ class BlockLink extends Module
|
||||
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'blocklink_shop WHERE id_blocklink='.(int)$id_link);
|
||||
foreach ($assos_shop as $asso)
|
||||
foreach ($asso as $id_shop => $row)
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'blocklink_shop', array(
|
||||
Db::getInstance()->insert('blocklink_shop', array(
|
||||
'id_blocklink' => (int)$id_link,
|
||||
'id_shop' => (int)$id_shop,
|
||||
), 'INSERT');
|
||||
));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,27 +49,25 @@ class MenuTopLinks
|
||||
if(!is_array($label))
|
||||
return false;
|
||||
|
||||
Db::getInstance()->autoExecute(
|
||||
_DB_PREFIX_.'linksmenutop',
|
||||
Db::getInstance()->insert(
|
||||
'linksmenutop',
|
||||
array(
|
||||
'new_window'=>(int)$newWindow,
|
||||
'link'=>pSQL($link),
|
||||
'id_shop' => (int)$id_shop
|
||||
),
|
||||
'INSERT'
|
||||
)
|
||||
);
|
||||
$id_linksmenutop = Db::getInstance()->Insert_ID();
|
||||
foreach($label as $id_lang=>$label)
|
||||
{
|
||||
Db::getInstance()->autoExecute(
|
||||
_DB_PREFIX_.'linksmenutop_lang',
|
||||
Db::getInstance()->insert(
|
||||
'linksmenutop_lang',
|
||||
array(
|
||||
'id_linksmenutop'=>(int)$id_linksmenutop,
|
||||
'id_lang'=>(int)$id_lang,
|
||||
'id_shop'=>(int)$id_shop,
|
||||
'label'=>pSQL($label)
|
||||
),
|
||||
'INSERT'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,14 +80,14 @@ class Editorial extends Module
|
||||
{
|
||||
$id_editorial = Db::getInstance()->Insert_ID();
|
||||
foreach (Language::getLanguages(false) as $lang)
|
||||
$res &= Db::getInstance()->autoExecute(_DB_PREFIX_.'editorial_lang', array(
|
||||
$res &= Db::getInstance()->insert('editorial_lang', array(
|
||||
'id_editorial' => $id_editorial,
|
||||
'id_lang' => $lang['id_lang'],
|
||||
'body_title' => 'Lorem ipsum dolor sit amet',
|
||||
'body_subheading' => 'Excepteur sint occaecat cupidatat non proident',
|
||||
'body_paragraph' => '<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p>',
|
||||
'body_logo_subheading' => 'Lorem ipsum presta shop amet',
|
||||
), 'INSERT');
|
||||
));
|
||||
}
|
||||
|
||||
if (!$res)
|
||||
|
||||
@@ -270,7 +270,7 @@ class Followup extends Module
|
||||
$values['id_cart'] = (int)($id_cart);
|
||||
if (!empty($id_customer))
|
||||
$values['id_customer'] = (int)($id_customer);
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'log_email', $values, 'INSERT');
|
||||
Db::getInstance()->insert('log_email', $values);
|
||||
}
|
||||
|
||||
/* Each cart which wasn't transformed into an order */
|
||||
|
||||
@@ -726,7 +726,7 @@ class shopimporter extends ImportModule
|
||||
$item['cart_products'][$k][$key] = $foreignKey[$key][$val];
|
||||
else
|
||||
$item['cart_products'][$k][$key] = 0;
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'cart_product', $item['cart_products'][$k],'INSERT');
|
||||
Db::getInstance()->insert('cart_product', $item['cart_products'][$k]);
|
||||
}
|
||||
foreach($item['order_products'] as $k => $order_products)
|
||||
{
|
||||
@@ -755,7 +755,7 @@ class shopimporter extends ImportModule
|
||||
$item['order_products'][$k][$key] = $foreignKey[$key][$val];
|
||||
else
|
||||
$item['order_products'][$k][$key] = 0;
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'order_detail', $item['order_products'][$k],'INSERT');
|
||||
Db::getInstance()->insert('order_detail', $item['order_products'][$k]);
|
||||
}
|
||||
//save order history
|
||||
foreach($item['order_history'] as $k => $order_history)
|
||||
@@ -767,7 +767,7 @@ class shopimporter extends ImportModule
|
||||
else
|
||||
$item['order_history'][$k][$key] = 0;
|
||||
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'order_history', $item['order_history'][$k],'INSERT');
|
||||
Db::getInstance()->insert('order_history', $item['order_history'][$k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user