Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableQuery::run_query()privateWC 1.0

Runs the SQL query.

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

Хуков нет.

Возвращает

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

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

// private - только в коде основоного (родительского) класса
$result = $this->run_query(): void;

Код OrdersTableQuery::run_query() WC 8.7.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( $this->count_sql ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
		$this->max_num_pages = (int) ceil( $this->found_orders / $this->args['limit'] );
	} else {
		$this->found_orders = count( $this->orders );
	}
}