Automattic\WooCommerce\Database\Migrations

TableMigrator::add_error()protectedWC 1.0

Add an error message to the errors list unless it's there already.

Method of the class: TableMigrator{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->add_error( $error ): void;
$error(string) (required)
The error message to add.

TableMigrator::add_error() code WC 7.1.0

protected function add_error( string $error ): void {
	if ( ! in_array( $error, $this->errors, true ) ) {
		$this->errors[] = $error;
	}
}