protected function _generateTargetAssociations($junction, $source, $target)
    {
        $junctionAlias = $junction->getAlias();
        $sAlias = $source->getAlias();

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

        if (!$target->hasAssociation($junctionAlias)) {
            $target->hasMany($junctionAlias, [
                'targetTable' => $junction,
                'foreignKey' => $this->getTargetForeignKey(),
                'strategy' => $this->_strategy,
            ]);
        }
        if (!$target->hasAssociation($sAlias)) {
            $target->belongsToMany($sAlias, [
                'sourceTable' => $target,
                'targetTable' => $source,
                'foreignKey' => $this->getTargetForeignKey(),
                'targetForeignKey' => $this->getForeignKey(),
                'through' => $junction,
                'conditions' => $this->getConditions(),
                'strategy' => $this->_strategy,
            ]);
        }
    }
protected function _generateTargetAssociations ( $ junction , $ source , $ target ) { $ junctionAlias = $ junction -> getAlias ( ) ; $ sAlias = $ source -> getAlias ( ) ; if ( ! $ target -> hasAssociation ( $ junctionAlias ) ) { $ target -> hasMany ( $ junctionAlias , [ 'targetTable' => $ junction , 'foreignKey' => $ this -> getTargetForeignKey ( ) , 'strategy' => $ this -> _strategy , ] ) ; } if ( ! $ target -> hasAssociation ( $ sAlias ) ) { $ target -> belongsToMany ( $ sAlias , [ 'sourceTable' => $ target , 'targetTable' => $ source , 'foreignKey' => $ this -> getTargetForeignKey ( ) , 'targetForeignKey' => $ this -> getForeignKey ( ) , 'through' => $ junction , 'conditions' => $ this -> getConditions ( ) , 'strategy' => $ this -> _strategy , ] ) ; } }
Generate reciprocal associations as necessary.

Generates the following associations:

- target hasMany junction e.g. Articles hasMany ArticlesTags
- target belongsToMany source e.g Articles belongsToMany Tags.

You can override these generated associations by defining associations
with the correct aliases.

@param \Cake\ORM\Table $junction The junction table.
@param \Cake\ORM\Table $source The source table.
@param \Cake\ORM\Table $target The target table.
@return void
Generate reciprocal associations as necessary .