// Db::autoExecute() call are now replaced by Db::insert() or Db::update()
This commit is contained in:
@@ -391,11 +391,11 @@ class InstallXmlLoader
|
||||
{
|
||||
foreach ($this->delayed_inserts as $entity => $queries)
|
||||
{
|
||||
$type = 'INSERT IGNORE';
|
||||
$type = Db::INSERT_IGNORE;
|
||||
if ($entity == 'access')
|
||||
$type = 'REPLACE';
|
||||
$type = Db::REPLACE;
|
||||
|
||||
if (!Db::getInstance()->autoExecute(_DB_PREFIX_.$entity, $queries, $type))
|
||||
if (!Db::getInstance()->insert($entity, $queries, false, true, $type))
|
||||
$this->setError($this->language->l('An SQL error occured for entity <i>%1$s</i>: <i>%2$s</i>', $entity, Db::getInstance()->getMsgError()));
|
||||
unset($this->delayed_inserts[$entity]);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ function generate_root_category_for_multishop()
|
||||
'name' => 'Root',
|
||||
'link_rewrite' => '',
|
||||
);
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'category_lang', $data, 'INSERT');
|
||||
Db::getInstance()->insert('category_lang', $data);
|
||||
|
||||
$categories = Db::getInstance()->executeS('
|
||||
SELECT `id_category`
|
||||
@@ -45,7 +45,7 @@ function generate_root_category_for_multishop()
|
||||
'id_category' => $category['id_category'],
|
||||
'id_shop' => $shop['id_shop']
|
||||
);
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'category_shop', $data, 'INSERT');
|
||||
Db::getInstance()->insert('category_shop', $data);
|
||||
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'category`
|
||||
|
||||
@@ -40,7 +40,7 @@ function generate_tax_rules()
|
||||
'id_tax' => $id_tax,
|
||||
'name' => 'Rule '.$tax['rate'].'%',
|
||||
);
|
||||
Db::getInstance()->AutoExecute(_DB_PREFIX_.'category_group', $row, 'INSERT');
|
||||
Db::getInstance()->insert('category_group', $row);
|
||||
$id_tax_rules_group = Db::getInstance()->insert_id;
|
||||
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ function migrate_block_info_to_cms_block()
|
||||
FROM `'._DB_PREFIX_.'configuration`
|
||||
WHERE name="PS_LANG_DEFAULT"');
|
||||
// 2) parent::install()
|
||||
$result = Db::getInstance()->AutoExecute(_DB_PREFIX_.'module',
|
||||
array('name' => 'blockcms', 'active' => 1), 'INSERT');
|
||||
$result = Db::getInstance()->insert('module',
|
||||
array('name' => 'blockcms', 'active' => 1));
|
||||
$id_module = Db::getInstance()->insert_Id();
|
||||
// 3) hooks
|
||||
$hooks = array('leftColumn', 'rightColumn', 'footer', 'header');
|
||||
@@ -56,7 +56,7 @@ function migrate_block_info_to_cms_block()
|
||||
FROM `'._DB_PREFIX_.'hook_module` hm
|
||||
LEFT JOIN `'._DB_PREFIX_.'hook` h on hm.id_hook=h.id_hook
|
||||
WHERE h.name = "'.$hook_name.'" group by id_hook');
|
||||
$res &= Db::getInstance()->AutoExecute(_DB_PREFIX_.'hook_module', $row, 'INSERT');
|
||||
$res &= Db::getInstance()->insert('hook_module', $row);
|
||||
}
|
||||
|
||||
// module install
|
||||
|
||||
@@ -43,7 +43,7 @@ function module_reinstall_blockmyaccount()
|
||||
FROM `'._DB_PREFIX_.'hook_module` hm
|
||||
LEFT JOIN `'._DB_PREFIX_.'hook` h on hm.id_hook=h.id_hook
|
||||
WHERE h.name = "'.$hook_name.'" group by id_hook');
|
||||
$res &= Db::getInstance()->AutoExecute(_DB_PREFIX_.'hook_module', $row, 'INSERT');
|
||||
$res &= Db::getInstance()->insert('hook_module', $row);
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ function module_reinstall_blocksearch()
|
||||
FROM `'._DB_PREFIX_.'hook_module` hm
|
||||
LEFT JOIN `'._DB_PREFIX_.'hook` h on hm.id_hook=h.id_hook
|
||||
WHERE h.name = "'.$hook_name.'" group by id_hook');
|
||||
$res &= Db::getInstance()->AutoExecute(_DB_PREFIX_.'hook_module', $row, 'INSERT');
|
||||
$res &= Db::getInstance()->insert('hook_module', $row);
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -35,13 +35,13 @@ function setAllGroupsOnHomeCategory()
|
||||
foreach ($results AS $result)
|
||||
$groups[] = $result['id_group'];
|
||||
|
||||
if (is_array($groups) && sizeof($groups))
|
||||
if (is_array($groups) && count($groups))
|
||||
{
|
||||
// cleanGroups
|
||||
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'category_group`
|
||||
WHERE `id_category` = 1');
|
||||
// addGroups($groups);
|
||||
$row = array('id_category' => 1, 'id_group' => (int)($groups));
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'category_group', $row, 'INSERT');
|
||||
$row = array('id_category' => 1, 'id_group' => (int)$groups);
|
||||
Db::getInstance()->insert('category_group', $row);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user