src/Query/FluentQuery.php
public function join( Table $table, $this_column, $other_column, $comparator = '=', $callback = null, $type = 'INNER' ) {

		$this->assert_comparator( $comparator );

		$other_alias = 't' . ( ++ $this->alias_count );

		$other_query              = new FluentQuery( $table, $this->wpdb );
		$other_query->alias       = $other_alias;
		$other_query->alias_count = $this->alias_count + 1;

		$other_query->joined_tables                 = $this->joined_tables;
		$other_query->joined_tables[ $this->alias ] = $this->table;

		$from = new From( $table->get_table_name( $this->wpdb ), $other_alias );

		$where = new Where_Raw(
			"{$this->prepare_column( $this_column )} $comparator {$other_query->prepare_column( $other_column )}"
		);

		if ( $callback ) {
			$callback( $other_query );

			if ( ! $other_query->where->is_empty() ) {
				$where->qAnd( $other_query->where );
			}
		}

		$this->joins[] = new Join( $from, $where, $type );

		$this->joined_tables[ $other_alias ] = $table;

		return $this;
	}
public function join( Table $table, $this_column, $other_column, $comparator = '=', $callback = null, $type = 'INNER' ) {

		$this->assert_comparator( $comparator );

		$other_alias = 't' . ( ++ $this->alias_count );

		$other_query              = new FluentQuery( $table, $this->wpdb );
		$other_query->alias       = $other_alias;
		$other_query->alias_count = $this->alias_count + 1;

		$other_query->joined_tables                 = $this->joined_tables;
		$other_query->joined_tables[ $this->alias ] = $this->table;

		$from = new From( $table->get_table_name( $this->wpdb ), $other_alias );

		$where = new Where_Raw(
			"{$this->prepare_column( $this_column )} $comparator {$other_query->prepare_column( $other_column )}"
		);

		if ( $callback ) {
			$callback( $other_query );

			if ( ! $other_query->where->is_empty() ) {
				$where->qAnd( $other_query->where );
			}
		}

		$this->joins[] = new Join( $from, $where, $type );

		$this->joined_tables[ $other_alias ] = $table;

		return $this;
	}
Simple join statement.

@since 2.0

@param Table       $table
@param string      $this_column
@param string      $other_column
@param bool|string $comparator
@param callable    $callback Called with a FluentQuery object. Can be used to build additional where queries
for the Join clause.
@param string      $type     Join type. Defaults to 'INNER'.

@return $this
@throws InvalidColumnException