Automattic\WooCommerce\Database\Migrations

TableMigrator::add_error()protectedWC 1.0

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

Метод класса: TableMigrator{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->add_error( $error ): void;
$error(строка) (обязательный)
The error message to add.

Код TableMigrator::add_error() WC 8.7.0

protected function add_error( string $error ): void {
	if ( is_null( $this->errors ) ) {
		$this->errors = array();
	}

	if ( ! in_array( $error, $this->errors, true ) ) {
		$this->errors[] = $error;
	}
}