Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableDataStore::join_address_table_order_query()privateWC 1.0

Helper method to generate join and select query for address table.

{} Это метод класса: OrdersTableDataStore{}

Хуков нет.

Возвращает

Массив. Select and join statements for address table.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->join_address_table_order_query( $address_type, $order_table_alias, $address_table_alias );
$address_type(строка) (обязательный)
Type of address. Typically will be billing or shipping.
$order_table_alias(строка) (обязательный)
Alias of order table to use.
$address_table_alias(строка) (обязательный)
Alias for address table to use.

Код OrdersTableDataStore::join_address_table_order_query() WC 6.6.1

private function join_address_table_order_query( $address_type, $order_table_alias, $address_table_alias ) {
	global $wpdb;
	$address_table    = $this::get_addresses_table_name();
	$column_props_map = 'billing' === $address_type ? $this->billing_address_column_mapping : $this->shipping_address_column_mapping;
	$clauses          = $this->generate_select_and_join_clauses( $order_table_alias, $address_table, $address_table_alias, $column_props_map );
	// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- $clauses['join'] and $address_table_alias are hardcoded.
	$clauses['join'] = $wpdb->prepare(
		"{$clauses['join']} AND $address_table_alias.address_type = %s",
		$address_type
	);

	// phpcs:enable
	return array(
		'select' => $clauses['select'],
		'join'   => $clauses['join'],
	);
}