Automattic\WooCommerce\Internal\DataStores\Orders
OrdersTableDataStore::generate_select_and_join_clauses()
Helper method to generate join and select clauses.
Method of the class: OrdersTableDataStore{}
No Hooks.
Return
Array
. Select and join queries.
Usage
// private - for code of main (parent) class only $result = $this->generate_select_and_join_clauses( $order_table_alias, $table, $table_alias, $column_props_map );
- $order_table_alias(string) (required)
- Alias for order table.
- $table(string) (required)
- Table to join.
- $table_alias(string) (required)
- Alias for table to join.
- $column_props_map(array[]) (required)
- Column to prop map for table to join.
OrdersTableDataStore::generate_select_and_join_clauses() OrdersTableDataStore::generate select and join clauses code WC 9.3.3
private function generate_select_and_join_clauses( $order_table_alias, $table, $table_alias, $column_props_map ) { // Add aliases to column names so they will be unique when fetching. $select_clause = $this->generate_select_clause_for_props( $table_alias, $column_props_map ); $join_clause = "$table $table_alias ON $table_alias.order_id = $order_table_alias.id"; return array( 'select' => $select_clause, 'join' => $join_clause, ); }