Automattic\WooCommerce\Database\Migrations
TableMigrator::db_get_results
Run $wpdb->get_results and add the error, if any, to the errors list.
Method of the class: TableMigrator{}
No Hooks.
Returns
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() TableMigrator::db get results code WC 10.4.3
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;
}