Automattic\WooCommerce\Database\Migrations

TableMigrator::db_get_results()protectedWC 1.0

Run $wpdb->get_results and add the error, if any, to the errors list.

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

No Hooks.

Return

Mixed. Whatever $wpdb->get_results returns.

Usage

// protected - for code of main (parent) or child class
$result = $this->db_get_results( $query, $output );
$query(string|null)
The SQL query to run.
Default: null
$output(string)
Any of ARRAY_A | ARRAY_N | OBJECT | OBJECT_K constants.
Default: OBJECT

Code of TableMigrator::db_get_results() WC 7.1.0

protected function db_get_results( string $query = null, string $output = OBJECT ) {
	$wpdb = WC()->get_global( 'wpdb' );

	// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
	$result = $wpdb->get_results( $query, $output );

	if ( '' !== $wpdb->last_error ) {
		$this->add_error( $wpdb->last_error );
	}

	return $result;
}