Automattic\WooCommerce\Database\Migrations

TableMigrator::maybe_add_insert_or_update_error()protectedWC 1.0

Check if the amount of processed database rows matches the amount of orders to process, and log an error if not.

Method of the class: TableMigrator{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->maybe_add_insert_or_update_error( $operation, $received_rows_count );
$operation(string) (required)
Operation performed, 'insert' or 'update'.
$received_rows_count(array|true|false) (required)
Value returned by @wpdb after executing the query.

TableMigrator::maybe_add_insert_or_update_error() code WC 7.1.1

protected function maybe_add_insert_or_update_error( string $operation, $received_rows_count ) {
	if ( false === $received_rows_count ) {
		$this->add_error( "$operation operation didn't complete, the database query failed" );
	}
}