original_string: protected function _generateJunctionAssociations($junction, $source, $target)
      {
          $tAlias = $target->getAlias();
          $sAlias = $source->getAlias();
  
          if (!$junction->hasAssociation($tAlias)) {
              $junction->belongsTo($tAlias, [
                  'foreignKey' => $this->getTargetForeignKey(),
                  'targetTable' => $target
              ]);
          }
          if (!$junction->hasAssociation($sAlias)) {
              $junction->belongsTo($sAlias, [
                  'foreignKey' => $this->getForeignKey(),
                  'targetTable' => $source
              ]);
          }
      }
code: protected function _generateJunctionAssociations($junction, $source, $target)
      {
          $tAlias = $target->getAlias();
          $sAlias = $source->getAlias();
  
          if (!$junction->hasAssociation($tAlias)) {
              $junction->belongsTo($tAlias, [
                  'foreignKey' => $this->getTargetForeignKey(),
                  'targetTable' => $target
              ]);
          }
          if (!$junction->hasAssociation($sAlias)) {
              $junction->belongsTo($sAlias, [
                  'foreignKey' => $this->getForeignKey(),
                  'targetTable' => $source
              ]);
          }
      }
code_tokens: protected function _generateJunctionAssociations ( $ junction , $ source , $ target ) { $ tAlias = $ target -> getAlias ( ) ; $ sAlias = $ source -> getAlias ( ) ; if ( ! $ junction -> hasAssociation ( $ tAlias ) ) { $ junction -> belongsTo ( $ tAlias , [ 'foreignKey' => $ this -> getTargetForeignKey ( ) , 'targetTable' => $ target ] ) ; } if ( ! $ junction -> hasAssociation ( $ sAlias ) ) { $ junction -> belongsTo ( $ sAlias , [ 'foreignKey' => $ this -> getForeignKey ( ) , 'targetTable' => $ source ] ) ; } }
docstring: Generate associations on the junction table as necessary
  
  Generates the following associations:
  
  - junction belongsTo source e.g. ArticlesTags belongsTo Tags
  - junction belongsTo target e.g. ArticlesTags belongsTo Articles
  
  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
docstring_tokens: Generate associations on the junction table as necessary