Automattic\WooCommerce\Database\Migrations
TableMigrator::maybe_add_insert_or_update_error()
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 (null).
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() TableMigrator::maybe add insert or update error code WC 9.7.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" ); } }