Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableQuery::run_query()privateWC 1.0

Runs the SQL query.

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

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->run_query(): void;

Код OrdersTableQuery::run_query() WC 7.1.0

private function run_query(): void {
	global $wpdb;

	// Run query.
	$this->orders = array_map( 'absint', $wpdb->get_col( $this->sql ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared

	// Set max_num_pages and found_orders if necessary.
	if ( ( $this->arg_isset( 'no_found_rows' ) && ! $this->args['no_found_rows'] ) || empty( $this->orders ) ) {
		return;
	}

	if ( $this->limits ) {
		$this->found_orders  = absint( $wpdb->get_var( 'SELECT FOUND_ROWS()' ) );
		$this->max_num_pages = (int) ceil( $this->found_orders / $this->args['limit'] );
	} else {
		$this->found_orders = count( $this->orders );
	}
}