[*] Classes: CMS::getCMSPages() now select only data from cms table if id_lang is null

[*] Classes: Db::autoExecute() can now take INSERT IGNORE as third argument
[*] Classes: Tag::addTags() can now take an array of tags as argument (instead of strings separated by comas)

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10033 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-11-10 13:45:41 +00:00
parent c1213e34bc
commit 3e268db6f9
3 changed files with 26 additions and 21 deletions
+5 -4
View File
@@ -246,7 +246,7 @@ abstract class DbCore
*
* @param string $table Table where insert/update data
* @param string $data Data to insert/update
* @param string $type INSERT or UPDATE
* @param string $type INSERT or INSERT IGNORE or UPDATE
* @param string $where WHERE clause, only for UPDATE (optional)
* @param string $limit LIMIT clause (optional)
* @param bool $use_null If true, replace empty strings and NULL by a NULL value
@@ -257,7 +257,8 @@ abstract class DbCore
if (!$data)
return true;
if (strtoupper($type) == 'INSERT')
$type = strtoupper($type);
if ($type == 'INSERT' || $type == 'INSERT IGNORE')
{
// Check if $data is a list of row
$current = current($data);
@@ -291,12 +292,12 @@ abstract class DbCore
$values_stringified[] = '('.implode(', ', $values).')';
}
$sql = 'INSERT INTO `'.$table.'` ('.$keys_stringified.') VALUES '.implode(', ', $values_stringified);
$sql = $type.' INTO `'.$table.'` ('.$keys_stringified.') VALUES '.implode(', ', $values_stringified);
if ($limit)
$sql .= ' LIMIT '.(int)$limit;
return $this->q($sql, $use_cache);
}
else if (strtoupper($type) == 'UPDATE')
else if ($type == 'UPDATE')
{
$sql = 'UPDATE `'.$table.'` SET ';
foreach ($data as $key => $value)