[*] Classes : table prefix is no longer required in Db::getInstance()->delete() method
This commit is contained in:
+8
-2
@@ -316,7 +316,8 @@ abstract class DbCore
|
||||
* @param array $data Data to insert as associative array. If $data is a list of arrays, multiple insert will be done
|
||||
* @param bool $null_values If we want to use NULL values instead of empty quotes
|
||||
* @param bool $use_cache
|
||||
* @param $type Must be Db::INSERT or Db::INSERT_IGNORE or Db::REPLACE
|
||||
* @param int $type Must be Db::INSERT or Db::INSERT_IGNORE or Db::REPLACE
|
||||
* @param bool $add_prefix Add or not _DB_PREFIX_ before table name
|
||||
* @return bool
|
||||
*/
|
||||
public function insert($table, $data, $null_values = false, $use_cache = true, $type = Db::INSERT, $add_prefix = true)
|
||||
@@ -379,6 +380,7 @@ abstract class DbCore
|
||||
* @param int $limit
|
||||
* @param bool $null_values If we want to use NULL values instead of empty quotes
|
||||
* @param bool $use_cache
|
||||
* @param bool $add_prefix Add or not _DB_PREFIX_ before table name
|
||||
* @return bool
|
||||
*/
|
||||
public function update($table, $data, $where = '', $limit = 0, $null_values = false, $use_cache = true, $add_prefix = true)
|
||||
@@ -415,10 +417,14 @@ abstract class DbCore
|
||||
* @param string $where WHERE clause on query
|
||||
* @param int $limit Number max of rows to delete
|
||||
* @param bool $use_cache Use cache or not
|
||||
* @param bool $add_prefix Add or not _DB_PREFIX_ before table name
|
||||
* @return bool
|
||||
*/
|
||||
public function delete($table, $where = '', $limit = 0, $use_cache = true)
|
||||
public function delete($table, $where = '', $limit = 0, $use_cache = true, $add_prefix = true)
|
||||
{
|
||||
if (_DB_PREFIX_ && !preg_match('#^'._DB_PREFIX_.'#i', $table) && $add_prefix)
|
||||
$table = _DB_PREFIX_.$table;
|
||||
|
||||
$this->result = false;
|
||||
$sql = 'DELETE FROM `'.bqSQL($table).'`'.($where ? ' WHERE '.$where : '').($limit ? ' LIMIT '.(int)$limit : '');
|
||||
$res = $this->query($sql);
|
||||
|
||||
Reference in New Issue
Block a user