diff --git a/src/ORM/Association/BelongsToMany.php b/src/ORM/Association/BelongsToMany.php index 212abbffee7..d4c2fcc620a 100644 --- a/src/ORM/Association/BelongsToMany.php +++ b/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, ]); } }