summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2011-10-20 08:44:48 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-10-27 01:02:07 +0200
commitcfe49186f26cd7bb6410abd4f1069b49325dc0e9 (patch)
treee9254cd0c5b34b96e817e7147462f0fa4ed6ea2e
parentc622a4155d912ad53143f5de94298eb8e60ba3e7 (diff)
Some public and protected method declarations
-rw-r--r--system/database/DB_result.php46
-rw-r--r--system/database/drivers/oci8/oci8_driver.php60
-rw-r--r--system/database/drivers/oci8/oci8_result.php12
3 files changed, 59 insertions, 59 deletions
diff --git a/system/database/DB_result.php b/system/database/DB_result.php
index 0c4e78105..48d66c8e4 100644
--- a/system/database/DB_result.php
+++ b/system/database/DB_result.php
@@ -45,7 +45,7 @@ class CI_DB_result {
* @param string can be "object" or "array"
* @return mixed either a result object or array
*/
- function result($type = 'object')
+ public function result($type = 'object')
{
if ($type == 'array') return $this->result_array();
else if ($type == 'object') return $this->result_object();
@@ -60,7 +60,7 @@ class CI_DB_result {
* @param class_name A string that represents the type of object you want back
* @return array of objects
*/
- function custom_result_object($class_name)
+ public function custom_result_object($class_name)
{
if (array_key_exists($class_name, $this->custom_result_object))
{
@@ -79,12 +79,12 @@ class CI_DB_result {
while ($row = $this->_fetch_object())
{
$object = new $class_name();
-
+
foreach ($row as $key => $value)
{
$object->$key = $value;
}
-
+
$result_object[] = $object;
}
@@ -100,7 +100,7 @@ class CI_DB_result {
* @access public
* @return object
*/
- function result_object()
+ public function result_object()
{
if (count($this->result_object) > 0)
{
@@ -132,7 +132,7 @@ class CI_DB_result {
* @access public
* @return array
*/
- function result_array()
+ public function result_array()
{
if (count($this->result_array) > 0)
{
@@ -166,7 +166,7 @@ class CI_DB_result {
* @param string can be "object" or "array"
* @return mixed either a result object or array
*/
- function row($n = 0, $type = 'object')
+ public function row($n = 0, $type = 'object')
{
if ( ! is_numeric($n))
{
@@ -198,7 +198,7 @@ class CI_DB_result {
* @access public
* @return object
*/
- function set_row($key, $value = NULL)
+ public function set_row($key, $value = NULL)
{
// We cache the row data for subsequent uses
if ( ! is_array($this->row_data))
@@ -230,7 +230,7 @@ class CI_DB_result {
* @access public
* @return object
*/
- function custom_row_object($n, $type)
+ public function custom_row_object($n, $type)
{
$result = $this->custom_result_object($type);
@@ -253,7 +253,7 @@ class CI_DB_result {
* @access public
* @return object
*/
- function row_object($n = 0)
+ public function row_object($n = 0)
{
$result = $this->result_object();
@@ -278,7 +278,7 @@ class CI_DB_result {
* @access public
* @return array
*/
- function row_array($n = 0)
+ public function row_array($n = 0)
{
$result = $this->result_array();
@@ -304,7 +304,7 @@ class CI_DB_result {
* @access public
* @return object
*/
- function first_row($type = 'object')
+ public function first_row($type = 'object')
{
$result = $this->result($type);
@@ -323,7 +323,7 @@ class CI_DB_result {
* @access public
* @return object
*/
- function last_row($type = 'object')
+ public function last_row($type = 'object')
{
$result = $this->result($type);
@@ -342,7 +342,7 @@ class CI_DB_result {
* @access public
* @return object
*/
- function next_row($type = 'object')
+ public function next_row($type = 'object')
{
$result = $this->result($type);
@@ -367,7 +367,7 @@ class CI_DB_result {
* @access public
* @return object
*/
- function previous_row($type = 'object')
+ public function previous_row($type = 'object')
{
$result = $this->result($type);
@@ -394,14 +394,14 @@ class CI_DB_result {
* operational due to the unavailability of the database resource IDs with
* cached results.
*/
- function num_rows() { return $this->num_rows; }
- function num_fields() { return 0; }
- function list_fields() { return array(); }
- function field_data() { return array(); }
- function free_result() { return TRUE; }
- function _data_seek() { return TRUE; }
- function _fetch_assoc() { return array(); }
- function _fetch_object() { return array(); }
+ public function num_rows() { return $this->num_rows; }
+ public function num_fields() { return 0; }
+ public function list_fields() { return array(); }
+ public function field_data() { return array(); }
+ public function free_result() { return TRUE; }
+ protected function _data_seek() { return TRUE; }
+ protected function _fetch_assoc() { return array(); }
+ protected function _fetch_object() { return array(); }
}
// END DB_result class
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php
index 985466a79..b4da3e965 100644
--- a/system/database/drivers/oci8/oci8_driver.php
+++ b/system/database/drivers/oci8/oci8_driver.php
@@ -145,10 +145,10 @@ class CI_DB_oci8_driver extends CI_DB {
/**
* Version number query string
*
- * @access public
+ * @access protected
* @return string
*/
- public function _version()
+ protected function _version()
{
return oci_server_version($this->conn_id);
}
@@ -158,11 +158,11 @@ class CI_DB_oci8_driver extends CI_DB {
/**
* Execute the query
*
- * @access public called by the base class
+ * @access protected called by the base class
* @param string an SQL query
* @return resource
*/
- public function _execute($sql)
+ protected function _execute($sql)
{
// oracle must parse the query before it is run. All of the actions with
// the query are based on the statement id returned by ociparse
@@ -480,11 +480,11 @@ class CI_DB_oci8_driver extends CI_DB {
*
* Generates a platform-specific query string so that the table names can be fetched
*
- * @access public
+ * @access protected
* @param boolean
* @return string
*/
- public function _list_tables($prefix_limit = FALSE)
+ protected function _list_tables($prefix_limit = FALSE)
{
$sql = "SELECT TABLE_NAME FROM ALL_TABLES";
@@ -503,11 +503,11 @@ class CI_DB_oci8_driver extends CI_DB {
*
* Generates a platform-specific query string so that the column names can be fetched
*
- * @access public
+ * @access protected
* @param string the table name
* @return string
*/
- public function _list_columns($table = '')
+ protected function _list_columns($table = '')
{
return "SELECT COLUMN_NAME FROM all_tab_columns WHERE table_name = '$table'";
}
@@ -523,7 +523,7 @@ class CI_DB_oci8_driver extends CI_DB {
* @param string the table name
* @return object
*/
- public function _field_data($table)
+ protected function _field_data($table)
{
return "SELECT * FROM ".$table." where rownum = 1";
}
@@ -533,10 +533,10 @@ class CI_DB_oci8_driver extends CI_DB {
/**
* The error message string
*
- * @access public
+ * @access protected
* @return string
*/
- public function _error_message()
+ protected function _error_message()
{
// If the error was during connection, no conn_id should be passed
$error = is_resource($this->conn_id) ? oci_error($this->conn_id) : oci_error();
@@ -548,10 +548,10 @@ class CI_DB_oci8_driver extends CI_DB {
/**
* The error message number
*
- * @access public
+ * @access protected
* @return integer
*/
- public function _error_number()
+ protected function _error_number()
{
// Same as _error_message()
$error = is_resource($this->conn_id) ? oci_error($this->conn_id) : oci_error();
@@ -565,11 +565,11 @@ class CI_DB_oci8_driver extends CI_DB {
*
* This function escapes column and table names
*
- * @access public
+ * @access protected
* @param string
* @return string
*/
- public function _escape_identifiers($item)
+ protected function _escape_identifiers($item)
{
if ($this->_escape_char == '')
{
@@ -608,11 +608,11 @@ class CI_DB_oci8_driver extends CI_DB {
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
- * @access public
+ * @access protected
* @param type
* @return type
*/
- public function _from_tables($tables)
+ protected function _from_tables($tables)
{
if ( ! is_array($tables))
{
@@ -635,7 +635,7 @@ class CI_DB_oci8_driver extends CI_DB {
* @param array the insert values
* @return string
*/
- public function _insert($table, $keys, $values)
+ protected function _insert($table, $keys, $values)
{
return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
}
@@ -647,13 +647,13 @@ class CI_DB_oci8_driver extends CI_DB {
*
* Generates a platform-specific insert string from the supplied data
*
- * @access public
+ * @access protected
* @param string the table name
* @param array the insert keys
* @param array the insert values
* @return string
*/
- public function _insert_batch($table, $keys, $values)
+ protected function _insert_batch($table, $keys, $values)
{
$keys = implode(', ', $keys);
$sql = "INSERT ALL\n";
@@ -675,7 +675,7 @@ class CI_DB_oci8_driver extends CI_DB {
*
* Generates a platform-specific update string from the supplied data
*
- * @access public
+ * @access protected
* @param string the table name
* @param array the update data
* @param array the where clause
@@ -683,7 +683,7 @@ class CI_DB_oci8_driver extends CI_DB {
* @param array the limit clause
* @return string
*/
- public function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
+ protected function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
{
foreach ($values as $key => $val)
{
@@ -712,11 +712,11 @@ class CI_DB_oci8_driver extends CI_DB {
* If the database does not support the truncate() command
* This function maps to "DELETE FROM table"
*
- * @access public
+ * @access protected
* @param string the table name
* @return string
*/
- public function _truncate($table)
+ protected function _truncate($table)
{
return "TRUNCATE TABLE ".$table;
}
@@ -728,13 +728,13 @@ class CI_DB_oci8_driver extends CI_DB {
*
* Generates a platform-specific delete string from the supplied data
*
- * @access public
+ * @access protected
* @param string the table name
* @param array the where clause
* @param string the limit clause
* @return string
*/
- public function _delete($table, $where = array(), $like = array(), $limit = FALSE)
+ protected function _delete($table, $where = array(), $like = array(), $limit = FALSE)
{
$conditions = '';
@@ -762,13 +762,13 @@ class CI_DB_oci8_driver extends CI_DB {
*
* Generates a platform-specific LIMIT clause
*
- * @access public
+ * @access protected
* @param string the sql query string
* @param integer the number of rows to limit the query to
* @param integer the offset value
* @return string
*/
- public function _limit($sql, $limit, $offset)
+ protected function _limit($sql, $limit, $offset)
{
$limit = $offset + $limit;
$newsql = "SELECT * FROM (select inner_query.*, rownum rnum FROM ($sql) inner_query WHERE rownum < $limit)";
@@ -789,11 +789,11 @@ class CI_DB_oci8_driver extends CI_DB {
/**
* Close DB Connection
*
- * @access public
+ * @access protected
* @param resource
* @return void
*/
- public function _close($conn_id)
+ protected function _close($conn_id)
{
@oci_close($conn_id);
}
diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php
index ea5f77537..ae133d7b5 100644
--- a/system/database/drivers/oci8/oci8_result.php
+++ b/system/database/drivers/oci8/oci8_result.php
@@ -146,10 +146,10 @@ class CI_DB_oci8_result extends CI_DB_result {
*
* Returns the result set as an array
*
- * @access public
+ * @access protected
* @return array
*/
- public function _fetch_assoc()
+ protected function _fetch_assoc()
{
$id = ($this->curs_id) ? $this->curs_id : $this->stmt_id;
return oci_fetch_assoc($id);
@@ -162,10 +162,10 @@ class CI_DB_oci8_result extends CI_DB_result {
*
* Returns the result set as an object
*
- * @access public
+ * @access protected
* @return object
*/
- public function _fetch_object()
+ protected function _fetch_object()
{
$id = ($this->curs_id) ? $this->curs_id : $this->stmt_id;
return @oci_fetch_object($id);
@@ -204,10 +204,10 @@ class CI_DB_oci8_result extends CI_DB_result {
* this internally before fetching results to make sure the
* result set starts at zero
*
- * @access public
+ * @access protected
* @return array
*/
- public function _data_seek($n = 0)
+ protected function _data_seek($n = 0)
{
return FALSE; // Not needed
}