Skip to content

Commit

Permalink
Preserve strategy option in associations generated in BelongsToMany
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpustulka committed Sep 30, 2016
1 parent d1a1d30 commit 79d24b9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ORM/Association/BelongsToMany.php
Expand Up @@ -241,6 +241,7 @@ protected function _generateTargetAssociations($junction, $source, $target)
$target->hasMany($junctionAlias, [
'targetTable' => $junction,
'foreignKey' => $this->targetForeignKey(),
'strategy' => $this->_strategy,
]);
}
if (!$target->association($sAlias)) {
Expand All @@ -251,6 +252,7 @@ protected function _generateTargetAssociations($junction, $source, $target)
'targetForeignKey' => $this->foreignKey(),
'through' => $junction,
'conditions' => $this->conditions(),
'strategy' => $this->_strategy,
]);
}
}
Expand All @@ -276,6 +278,7 @@ protected function _generateSourceAssociations($junction, $source)
$source->hasMany($junctionAlias, [
'targetTable' => $junction,
'foreignKey' => $this->foreignKey(),
'strategy' => $this->_strategy,
]);
}
}
Expand Down

0 comments on commit 79d24b9

Please sign in to comment.