Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableQuery::__construct()publicWC 1.0

Sets up and runs the query after processing arguments.

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

No Hooks.

Return

null. Nothing.

Usage

$OrdersTableQuery = new OrdersTableQuery();
$OrdersTableQuery->__construct( $args );
$args(array)
Array of query vars.
Default: array()

Code of OrdersTableQuery::__construct() WC 7.1.0

public function __construct( $args = array() ) {
	global $wpdb;

	$datastore = wc_get_container()->get( OrdersTableDataStore::class );

	// TODO: maybe OrdersTableDataStore::get_all_table_names() could return these keys/indices instead.
	$this->tables   = array(
		'orders'           => $datastore::get_orders_table_name(),
		'addresses'        => $datastore::get_addresses_table_name(),
		'operational_data' => $datastore::get_operational_data_table_name(),
		'meta'             => $datastore::get_meta_table_name(),
		'items'            => $wpdb->prefix . 'woocommerce_order_items',
	);
	$this->mappings = $datastore->get_all_order_column_mappings();

	$this->args = $args;

	// TODO: args to be implemented.
	unset( $this->args['customer_note'], $this->args['name'] );

	$this->build_query();
	$this->run_query();
}