Automattic\WooCommerce\Internal\DataStores\Orders
OrdersTableQuery::__construct
Sets up and runs the query after processing arguments.
Method of the class: OrdersTableQuery{}
No Hooks.
Returns
null. Nothing (null).
Usage
$OrdersTableQuery = new OrdersTableQuery(); $OrdersTableQuery->__construct( $args );
- $args(array)
- Array of query vars.
Default:array()
OrdersTableQuery::__construct() OrdersTableQuery:: construct code WC 10.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;
$this->query_args = $args; // Keep a copy of the original vars used to initialize the query.
// TODO: args to be implemented.
unset( $this->args['customer_note'], $this->args['name'] );
$this->build_query();
if ( ! $this->maybe_override_query() ) {
$this->run_query();
}
}