Automattic\WooCommerce\Internal\OrderWithdrawal

OrderWithdrawalFormState{} │ final │ WC 1.0

Holds the processed order withdrawal form state.

No Hooks.

Usage

$OrderWithdrawalFormState = new OrderWithdrawalFormState();
// use class methods

Methods

  1. public __construct( string $screen, array $data, array $errors )

OrderWithdrawalFormState{} code WC 11.1.2

final class OrderWithdrawalFormState {

	/**
	 * Current screen.
	 *
	 * @var string
	 */
	public string $screen;

	/**
	 * Sanitized form data.
	 *
	 * @var array<string,string>
	 */
	public array $data;

	/**
	 * Validation errors keyed by field.
	 *
	 * @var array<string,string>
	 */
	public array $errors;

	/**
	 * Initialize form state.
	 *
	 * @param string               $screen Current screen.
	 * @param array<string,string> $data Sanitized form data.
	 * @param array<string,string> $errors Validation errors keyed by field.
	 *
	 * @since 11.1.0
	 */
	public function __construct( string $screen, array $data, array $errors ) {
		$this->screen = $screen;
		$this->data   = $data;
		$this->errors = $errors;
	}
}