Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated __construct() to add dbprefix #152

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion core/MY_Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ public function __construct()

$this->_fetch_table();
$this->_database = $this->db;

//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');
Expand Down Expand Up @@ -444,6 +447,11 @@ public function with($relationship)

return $this;
}

public function with_r($relationship)
{
//DO STUFF HERE
}

public function relate($row)
{
Expand Down Expand Up @@ -890,4 +898,4 @@ protected function _return_type($multi = FALSE)
$method = ($multi) ? 'result' : 'row';
return $this->_temporary_return_type == 'array' ? $method . '_array' : $method;
}
}
}