Leenooks customisations for Kohana

This commit is contained in:
Deon George 2013-04-22 14:21:45 +10:00
parent 4cabe0db4f
commit 5ffa395307

View File

@ -690,7 +690,8 @@ class Kohana_ORM extends Model implements serializable {
$join_col1 = ($this->_disable_join_table_name ? '' : $through.'.').$this->_has_many[$column]['far_key']; $join_col1 = ($this->_disable_join_table_name ? '' : $through.'.').$this->_has_many[$column]['far_key'];
$join_col2 = ($this->_disable_join_table_name ? '' : $model->_object_name.'.').$model->_primary_key; $join_col2 = ($this->_disable_join_table_name ? '' : $model->_object_name.'.').$model->_primary_key;
$model->join($through)->on($join_col1, '=', $join_col2); $model->join($through)->on($join_col1, '=', $join_col2)
->on(($this->_disable_join_table_name ? '' : $through.'.').'site_id', '=', ($this->_disable_join_table_name ? '' : $model->_object_name.'.').'site_id');
// Through table's source foreign key (foreign_key) should be this model's primary key // Through table's source foreign key (foreign_key) should be this model's primary key
$col = ($this->_disable_join_table_name ? '' : $through.'.').$this->_has_many[$column]['foreign_key']; $col = ($this->_disable_join_table_name ? '' : $through.'.').$this->_has_many[$column]['foreign_key'];