Added getting site config from DB

This commit is contained in:
Deon George
2011-09-29 17:13:32 +10:00
parent b6802e4b5d
commit 147d035e46
6 changed files with 77 additions and 40 deletions

View File

@@ -39,7 +39,9 @@ class ORM extends Kohana_ORM {
// Add our OSB site_id to each SELECT query
final protected function _build($type) {
$this->where($this->_table_name.'.site_id','=',Config::siteid());
// Exclude tables without site ID's
if (! in_array($this->_table_name,array('setup','country','currency','tax')))
$this->where($this->_table_name.'.site_id','=',Config::siteid());
return parent::_build($type);
}