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.

Method of the class: 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( ?string $query, $output );
?string $query **
-
Default: null
$output(string)
Any of ARRAY_A | ARRAY_N | OBJECT | OBJECT_K constants.
Default: OBJECT

TableMigrator::db_get_results() code WC 9.7.1

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;
}