Merge pull request #162 from bumbu/patch-2

[-] CORE : updateMultishopTable() where argument is not mandatory anymore
This commit is contained in:
Gregory Roussac
2013-07-24 10:07:56 -07:00
3 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -1322,7 +1322,7 @@ abstract class ObjectModelCore
* @param string $specific_where Only executed for common table * @param string $specific_where Only executed for common table
* @return bool * @return bool
*/ */
public static function updateMultishopTable($classname, $data, $where, $specific_where = '') public static function updateMultishopTable($classname, $data, $where = '', $specific_where = '')
{ {
$def = ObjectModel::getDefinition($classname); $def = ObjectModel::getDefinition($classname);
$update_data = array(); $update_data = array();
@@ -1342,8 +1342,8 @@ abstract class ObjectModelCore
$sql = 'UPDATE '._DB_PREFIX_.$def['table'].' a $sql = 'UPDATE '._DB_PREFIX_.$def['table'].' a
'.Shop::addSqlAssociation($def['table'], 'a', true, null, true).' '.Shop::addSqlAssociation($def['table'], 'a', true, null, true).'
SET '.implode(', ', $update_data).' SET '.implode(', ', $update_data).
WHERE '.$where; (!empty($where) ? ' WHERE '.$where : '');
return Db::getInstance()->execute($sql); return Db::getInstance()->execute($sql);
} }
+2 -2
View File
@@ -4751,7 +4751,7 @@ class ProductCore extends ObjectModel
{ {
return ObjectModel::updateMultishopTable('product', array( return ObjectModel::updateMultishopTable('product', array(
'ecotax' => 0, 'ecotax' => 0,
), ''); ));
} }
/** /**
@@ -5380,4 +5380,4 @@ class ProductCore extends ObjectModel
Pack::addItem($this->id, (int)$item['id'], (int)$item['quantity']); Pack::addItem($this->id, (int)$item['id'], (int)$item['quantity']);
return true; return true;
} }
} }
+1 -1
View File
@@ -410,7 +410,7 @@ class SearchCore
{ {
$db->execute('TRUNCATE '._DB_PREFIX_.'search_index'); $db->execute('TRUNCATE '._DB_PREFIX_.'search_index');
$db->execute('TRUNCATE '._DB_PREFIX_.'search_word'); $db->execute('TRUNCATE '._DB_PREFIX_.'search_word');
ObjectModel::updateMultishopTable('Product', array('indexed' => 0), '1'); ObjectModel::updateMultishopTable('Product', array('indexed' => 0));
} }
else else
{ {