protected function _generateTargetAssociations($junction, $source, $target)
{
$junctionAlias = $junction->alias();
$sAlias = $source->alias();
if (!$target->association($junctionAlias)) {
$target->hasMany($junctionAlias, ['targetTable' => $junction, 'foreignKey' => $this->targetForeignKey(), 'strategy' => $this->_strategy]);
}
if (!$target->association($sAlias)) {
$target->belongsToMany($sAlias, ['sourceTable' => $target, 'targetTable' => $source, 'foreignKey' => $this->targetForeignKey(), 'targetForeignKey' => $this->foreignKey(), 'through' => $junction, 'conditions' => $this->conditions(), 'strategy' => $this->_strategy]);
}
}