Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableQuery::__construct()publicWC 1.0

Sets up and runs the query after processing arguments.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$OrdersTableQuery = new OrdersTableQuery();
$OrdersTableQuery->__construct( $args );
$args(массив)
Array of query vars.
По умолчанию: array()

Код OrdersTableQuery::__construct() WC 8.7.0

public function __construct( $args = array() ) {
	// Note that ideally we would inject this dependency via constructor, but that's not possible since this class needs to be backward compatible with WC_Order_Query class.
	$this->order_datastore = wc_get_container()->get( OrdersTableDataStore::class );

	$this->tables   = $this->order_datastore::get_all_table_names_with_id();
	$this->mappings = $this->order_datastore->get_all_order_column_mappings();

	$this->suppress_filters = array_key_exists( 'suppress_filters', $args ) ? (bool) $args['suppress_filters'] : false;
	unset( $args['suppress_filters'] );

	$this->args = $args;

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

	$this->build_query();
	if ( ! $this->maybe_override_query() ) {
		$this->run_query();
	}
}