Upstream Patch: ORM enhancements for PTA
This commit is contained in:
parent
2d7cfd3eb3
commit
338be6719e
@ -705,7 +705,7 @@ class Kohana_ORM extends Model implements serializable {
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($this->_has_many[$column]['foreign_key'] as $fk)
|
||||
foreach ($this->_has_many[$column]['foreign_key'] as $mk => $fk)
|
||||
{
|
||||
if (isset($this->_has_many[$column]['through']))
|
||||
{
|
||||
@ -715,7 +715,7 @@ class Kohana_ORM extends Model implements serializable {
|
||||
{
|
||||
// Simple has_many relationship, search where target model's foreign key is this model's primary key
|
||||
$col = ($this->_disable_join_table_name ? '' : $model->_table_name.'.').$fk;
|
||||
$val = $this->_object[$fk];
|
||||
$val = $this->_object[$mk];
|
||||
}
|
||||
|
||||
$model = $model->where($col, '=', $val);
|
||||
|
Reference in New Issue
Block a user