From a3bca8f8c1e4cca5d763cbfe043999cbfd07cd21 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 5 Apr 2012 15:17:25 +0300 Subject: Replaced driver instances of _replace() with one in CI_DB_active_record --- system/database/DB_active_rec.php | 33 ++++++++++++++++++------ system/database/drivers/cubrid/cubrid_driver.php | 17 ------------ system/database/drivers/mysql/mysql_driver.php | 17 ------------ system/database/drivers/mysqli/mysqli_driver.php | 17 ------------ 4 files changed, 25 insertions(+), 59 deletions(-) (limited to 'system') diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 22b57082e..f5dcd3dd7 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -1223,10 +1223,10 @@ abstract class CI_DB_active_record extends CI_DB_driver { * * Generates a platform-specific insert string from the supplied data. * - * @param string the table name - * @param array the insert keys - * @param array the insert values - * @return string + * @param string the table name + * @param array the insert keys + * @param array the insert values + * @return string */ protected function _insert_batch($table, $keys, $values) { @@ -1362,10 +1362,10 @@ abstract class CI_DB_active_record extends CI_DB_driver { * * Generates a platform-specific insert string from the supplied data * - * @param string the table name - * @param array the insert keys - * @param array the insert values - * @return string + * @param string the table name + * @param array the insert keys + * @param array the insert values + * @return string */ protected function _insert($table, $keys, $values) { @@ -1446,6 +1446,23 @@ abstract class CI_DB_active_record extends CI_DB_driver { // -------------------------------------------------------------------- + /** + * Replace statement + * + * Generates a platform-specific replace string from the supplied data + * + * @param string the table name + * @param array the insert keys + * @param array the insert values + * @return string + */ + protected function _replace($table, $keys, $values) + { + return 'REPLACE INTO '.$table.' ('.implode(', ', $keys).') VALUES ('.implode(', ', $values).')'; + } + + // -------------------------------------------------------------------- + /** * Get UPDATE query string * diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php index 426797f4f..cf9a351d2 100644 --- a/system/database/drivers/cubrid/cubrid_driver.php +++ b/system/database/drivers/cubrid/cubrid_driver.php @@ -497,23 +497,6 @@ class CI_DB_cubrid_driver extends CI_DB { // -------------------------------------------------------------------- - /** - * Replace statement - * - * Generates a platform-specific replace string from the supplied data - * - * @param string the table name - * @param array the insert keys - * @param array the insert values - * @return string - */ - protected function _replace($table, $keys, $values) - { - return "REPLACE INTO ".$table." (\"".implode('", "', $keys)."\") VALUES (".implode(', ', $values).")"; - } - - // -------------------------------------------------------------------- - /** * Update_Batch statement * diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 563a387b3..7f43be5f4 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -496,23 +496,6 @@ class CI_DB_mysql_driver extends CI_DB { // -------------------------------------------------------------------- - /** - * Replace statement - * - * Generates a platform-specific replace string from the supplied data - * - * @param string the table name - * @param array the insert keys - * @param array the insert values - * @return string - */ - protected function _replace($table, $keys, $values) - { - return 'REPLACE INTO '.$table.' ('.implode(', ', $keys).') VALUES ('.implode(', ', $values).')'; - } - - // -------------------------------------------------------------------- - /** * Update statement * diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 565e3f4c0..26a77aa75 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -496,23 +496,6 @@ class CI_DB_mysqli_driver extends CI_DB { // -------------------------------------------------------------------- - /** - * Replace statement - * - * Generates a platform-specific replace string from the supplied data - * - * @param string the table name - * @param array the insert keys - * @param array the insert values - * @return string - */ - protected function _replace($table, $keys, $values) - { - return 'REPLACE INTO '.$table.' ('.implode(', ', $keys).') VALUES ('.implode(', ', $values).')'; - } - - // -------------------------------------------------------------------- - /** * Update_Batch statement * -- cgit v1.2.3-24-g4f1b