Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableDataStore::generate_select_clause_for_props()privateWC 1.0

Helper method to generate select clause for props.

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

No Hooks.

Return

String. Select clause.

Usage

// private - for code of main (parent) class only
$result = $this->generate_select_clause_for_props( $table_alias, $props );
$table_alias(string) (required)
Alias for table.
$props(array[]) (required)
Props to column mapping for table.

Код OrdersTableDataStore::generate_select_clause_for_props() WC 7.1.0

private function generate_select_clause_for_props( $table_alias, $props ) {
	$select_clauses = array();
	foreach ( $props as $column_name => $prop_details ) {
		$select_clauses[] = isset( $prop_details['name'] ) ? "$table_alias.$column_name as {$prop_details['name']}" : "$table_alias.$column_name as {$table_alias}_$column_name";
	}

	return implode( ', ', $select_clauses );
}