summaryrefslogtreecommitdiffstats
path: root/system/database/DB_active_rec.php
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2008-01-23 00:44:32 +0100
committerDerek Allard <derek.allard@ellislab.com>2008-01-23 00:44:32 +0100
commit3b11868b3aa56c83419d904435a5b7dfbf997063 (patch)
treefa79e092b37f32afb78c27bf13ec2cdd8ec42311 /system/database/DB_active_rec.php
parent571e2c280a4358202dff1888055038431f032eeb (diff)
Added $this->db->dbprefix() to manually add database prefixes.
Diffstat (limited to 'system/database/DB_active_rec.php')
-rw-r--r--system/database/DB_active_rec.php27
1 files changed, 24 insertions, 3 deletions
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php
index 08213af5c..ba68e1e8f 100644
--- a/system/database/DB_active_rec.php
+++ b/system/database/DB_active_rec.php
@@ -7,8 +7,8 @@
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2006, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
- * @link http://codeigniter.com
+ * @license http://www.codeigniter.com/user_guide/license.html
+ * @link http://www.codeigniter.com
* @since Version 1.0
* @filesource
*/
@@ -24,7 +24,7 @@
* @subpackage Drivers
* @category Database
* @author ExpressionEngine Dev Team
- * @link http://codeigniter.com/user_guide/database/
+ * @link http://www.codeigniter.com/user_guide/database/
*/
class CI_DB_active_record extends CI_DB_driver {
@@ -45,6 +45,27 @@ class CI_DB_active_record extends CI_DB_driver {
var $ar_aliased_tables = array();
/**
+ * DB Prefix
+ *
+ * Prepends a database prefix if one exists in configuration
+ *
+ * @access public
+ * @param string the table
+ * @return string
+ */
+ function dbprefix($table = '')
+ {
+ if ($table == '')
+ {
+ $this->display_error('db_table_name_required');
+ }
+
+ return $this->dbprefix.$table;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Select
*
* Generates the SELECT portion of the query