Builder::join( string $table_name, string $left_column, string $current_model_column )

Create a join clause with the single builder method.


Parameters

$table_name

(string) (Required) The name of the table to join.

$left_column

(string) (Required) The field on the table to join.

$current_model_column

(string) (Required) The field on the current model to join against with.


Top ↑

Return

($this)


Top ↑

Source

File: src/Events/Custom_Tables/V1/Models/Builder.php

	public function join( $table_name, $left_column, $current_model_column ) {
		if ( $this->invalid ) {
			return $this;
		}

		global $wpdb;

		$parts = [
			"JOIN `{$table_name}`",
			"ON `{$wpdb->prefix}{$this->model->table_name()}`.$current_model_column = `{$table_name}`.$left_column",
		];

		$this->joins[] = $parts;

		return $this;
	}

Top ↑

Changelog

Changelog
Version Description
6.0.0 Introduced.