From c066481ed558e764ab489449141d2489551b562f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 16:07:59 +0200 Subject: Visibility declarations and cleanup for MSSQL forge and utility classes --- system/database/drivers/mssql/mssql_forge.php | 43 +++++++++++-------------- system/database/drivers/mssql/mssql_utility.php | 26 ++++++--------- 2 files changed, 28 insertions(+), 41 deletions(-) (limited to 'system/database/drivers/mssql') diff --git a/system/database/drivers/mssql/mssql_forge.php b/system/database/drivers/mssql/mssql_forge.php index ee8b8f544..2e3e314ed 100644 --- a/system/database/drivers/mssql/mssql_forge.php +++ b/system/database/drivers/mssql/mssql_forge.php @@ -1,13 +1,13 @@ -db->_escape_identifiers($table); } @@ -80,15 +76,14 @@ class CI_DB_mssql_forge extends CI_DB_forge { /** * Create Table * - * @access private * @param string the table name * @param array the fields * @param mixed primary key(s) * @param mixed key(s) - * @param boolean should 'IF NOT EXISTS' be added to the SQL - * @return bool + * @param bool should 'IF NOT EXISTS' be added to the SQL + * @return string */ - function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -100,7 +95,7 @@ class CI_DB_mssql_forge extends CI_DB_forge { $sql .= $this->db->_escape_identifiers($table)." ("; $current_field_count = 0; - foreach ($fields as $field=>$attributes) + foreach ($fields as $field => $attributes) { // Numeric field names aren't allowed in databases, so if the key is // numeric, we know it was assigned by PHP and the developer manually @@ -190,17 +185,16 @@ class CI_DB_mssql_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * - * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name * @param string the column definition * @param string the default value - * @param boolean should 'NOT NULL' be added + * @param bool should 'NOT NULL' be added * @param string the field after which we should add the new field - * @return object + * @return string */ - function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -242,12 +236,11 @@ class CI_DB_mssql_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * - * @access private * @param string the old table name * @param string the new table name * @return string */ - function _rename_table($table_name, $new_table_name) + public function _rename_table($table_name, $new_table_name) { // I think this syntax will work, but can find little documentation on renaming tables in MSSQL return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); diff --git a/system/database/drivers/mssql/mssql_utility.php b/system/database/drivers/mssql/mssql_utility.php index 28f34b999..5c144330d 100644 --- a/system/database/drivers/mssql/mssql_utility.php +++ b/system/database/drivers/mssql/mssql_utility.php @@ -1,13 +1,13 @@ -db->display_error('db_unsuported_feature'); -- cgit v1.2.3-24-g4f1b