From 1427a911a39f0ac486f8102fa62962ba3c5146b3 Mon Sep 17 00:00:00 2001 From: "Kyle B. Johnson" Date: Wed, 22 Jan 2014 09:23:34 -0500 Subject: [PATCH 1/4] Updated __construct to add dbprefix --- core/MY_Model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/MY_Model.php b/core/MY_Model.php index 34cb9fe..d994c00 100644 --- a/core/MY_Model.php +++ b/core/MY_Model.php @@ -104,6 +104,7 @@ public function __construct() $this->load->helper('inflector'); $this->_fetch_table(); + $this->_table = $this->db->dbprefix($this->_table); $this->_database = $this->db; array_unshift($this->before_create, 'protect_attributes'); @@ -890,4 +891,4 @@ protected function _return_type($multi = FALSE) $method = ($multi) ? 'result' : 'row'; return $this->_temporary_return_type == 'array' ? $method . '_array' : $method; } -} \ No newline at end of file +} From ced9176a484c63269a08f6025a3b6165c1e165cb Mon Sep 17 00:00:00 2001 From: "Kyle B. Johnson" Date: Wed, 22 Jan 2014 11:05:24 -0500 Subject: [PATCH 2/4] Updated DB Prefix Updated DB Prefix using Specified Database Connection as opposed to assuming the default connection. --- core/MY_Model.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/MY_Model.php b/core/MY_Model.php index d994c00..c7a0386 100644 --- a/core/MY_Model.php +++ b/core/MY_Model.php @@ -104,8 +104,10 @@ public function __construct() $this->load->helper('inflector'); $this->_fetch_table(); - $this->_table = $this->db->dbprefix($this->_table); $this->_database = $this->db; + + //Append DB Prefix from Specified Database Connection + $this->_table = $this->_database->dbprefix($this->_table); array_unshift($this->before_create, 'protect_attributes'); array_unshift($this->before_update, 'protect_attributes'); From 3223168116cc0cd3f91b533618ace05446ceddc7 Mon Sep 17 00:00:00 2001 From: "Kyle B. Johnson" Date: Wed, 22 Jan 2014 11:08:36 -0500 Subject: [PATCH 3/4] Updated inline comment --- core/MY_Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/MY_Model.php b/core/MY_Model.php index c7a0386..9a4e671 100644 --- a/core/MY_Model.php +++ b/core/MY_Model.php @@ -106,7 +106,7 @@ public function __construct() $this->_fetch_table(); $this->_database = $this->db; - //Append DB Prefix from Specified Database Connection + //DB Prefix from Specified Database Connection $this->_table = $this->_database->dbprefix($this->_table); array_unshift($this->before_create, 'protect_attributes'); From aa18163fcbe8bc9bb41206f7aec4e4ed8d6fddf6 Mon Sep 17 00:00:00 2001 From: "Kyle B. Johnson" Date: Fri, 11 Jul 2014 16:29:43 -0400 Subject: [PATCH 4/4] Add with_r() method stub --- core/MY_Model.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/MY_Model.php b/core/MY_Model.php index 9a4e671..43debea 100644 --- a/core/MY_Model.php +++ b/core/MY_Model.php @@ -447,6 +447,11 @@ public function with($relationship) return $this; } + + public function with_r($relationship) + { + //DO STUFF HERE + } public function relate($row) {