Skip to content
Permalink
Browse files

Preserve strategy option in associations generated in BelongsToMany

  • Loading branch information...
robertpustulka committed Sep 30, 2016
1 parent d1a1d30 commit 79d24b9078530a63c5688efbc080accf62a5401e
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/ORM/Association/BelongsToMany.php
@@ -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)) {
@@ -251,6 +252,7 @@ protected function _generateTargetAssociations($junction, $source, $target)
'targetForeignKey' => $this->foreignKey(),
'through' => $junction,
'conditions' => $this->conditions(),
'strategy' => $this->_strategy,
]);
}
}
@@ -276,6 +278,7 @@ protected function _generateSourceAssociations($junction, $source)
$source->hasMany($junctionAlias, [
'targetTable' => $junction,
'foreignKey' => $this->foreignKey(),
'strategy' => $this->_strategy,
]);
}
}

0 comments on commit 79d24b9

Please sign in to comment.
You can’t perform that action at this time.