original_string: protected function _addJoin($type, $table, $fields, $on = []) {
          $repo = $this->getRepository();
          $join = new Join($type);
          $conditions = [];
  
          if (is_array($table)) {
              $alias = $table[1];
              $table = $table[0];
          } else {
              $alias = $table;
          }
  
          foreach ($on as $pfk => $rfk) {
              if (strpos($pfk, '.') === false) {
                  $pfk = $repo->getAlias() . '.' . $pfk;
              }
  
              if (strpos($rfk, '.') === false) {
                  $rfk = $alias . '.' . $rfk;
              }
  
              $conditions[$pfk] = $rfk;
          }
  
          $this->_joins[] = $join->from($table, $alias)->on($conditions)->fields($fields);
  
          return $this;
      }
code: protected function _addJoin($type, $table, $fields, $on = []) {
          $repo = $this->getRepository();
          $join = new Join($type);
          $conditions = [];
  
          if (is_array($table)) {
              $alias = $table[1];
              $table = $table[0];
          } else {
              $alias = $table;
          }
  
          foreach ($on as $pfk => $rfk) {
              if (strpos($pfk, '.') === false) {
                  $pfk = $repo->getAlias() . '.' . $pfk;
              }
  
              if (strpos($rfk, '.') === false) {
                  $rfk = $alias . '.' . $rfk;
              }
  
              $conditions[$pfk] = $rfk;
          }
  
          $this->_joins[] = $join->from($table, $alias)->on($conditions)->fields($fields);
  
          return $this;
      }
code_tokens: protected function _addJoin ( $ type , $ table , $ fields , $ on = [ ] ) { $ repo = $ this -> getRepository ( ) ; $ join = new Join ( $ type ) ; $ conditions = [ ] ; if ( is_array ( $ table ) ) { $ alias = $ table [ 1 ] ; $ table = $ table [ 0 ] ; } else { $ alias = $ table ; } foreach ( $ on as $ pfk => $ rfk ) { if ( strpos ( $ pfk , '.' ) === false ) { $ pfk = $ repo -> getAlias ( ) . '.' . $ pfk ; } if ( strpos ( $ rfk , '.' ) === false ) { $ rfk = $ alias . '.' . $ rfk ; } $ conditions [ $ pfk ] = $ rfk ; } $ this -> _joins [ ] = $ join -> from ( $ table , $ alias ) -> on ( $ conditions ) -> fields ( $ fields ) ; return $ this ; }
docstring: Add a new join type.
  
  @param string $type
  @param string|array $table
  @param array $fields
  @param array $on
  @return $this
docstring_tokens: Add a new join type .