Your IP : 216.73.217.81


Current Path : /home3/vocl2671/sinsport.be/wp-content/plugins/wpforms-lite/src/Admin/Dashboard/
Upload File :
Current File : //home3/vocl2671/sinsport.be/wp-content/plugins/wpforms-lite/src/Admin/Dashboard/WidgetState.php

<?php

namespace WPForms\Admin\Dashboard;

/**
 * Dashboard widget state value object.
 *
 * @since 2.0.2
 */
class WidgetState {

	/**
	 * Whether the widget should render.
	 *
	 * @since 2.0.2
	 *
	 * @var bool
	 */
	private $visible;

	/**
	 * Template variant: 'data', 'connect', 'education', 'install'.
	 *
	 * @since 2.0.2
	 *
	 * @var string
	 */
	private $variant;

	/**
	 * Dynamic sort position. Null means use the widget class ORDER constant.
	 *
	 * @since 2.0.2
	 *
	 * @var int|null
	 */
	private $order_override;

	/**
	 * Constructor.
	 *
	 * @since 2.0.2
	 *
	 * @param bool     $visible        Whether the widget should render.
	 * @param string   $variant        Template variant.
	 * @param int|null $order_override Dynamic sort position.
	 */
	public function __construct( bool $visible, string $variant = '', ?int $order_override = null ) {

		$this->visible        = $visible;
		$this->variant        = $variant;
		$this->order_override = $order_override;
	}

	/**
	 * Whether the widget should render.
	 *
	 * @since 2.0.2
	 *
	 * @return bool
	 */
	public function is_visible(): bool {

		return $this->visible;
	}

	/**
	 * Get the template variant.
	 *
	 * @since 2.0.2
	 *
	 * @return string
	 */
	public function get_variant(): string {

		return $this->variant;
	}

	/**
	 * Get the dynamic sort position, or null to use the widget ORDER constant.
	 *
	 * @since 2.0.2
	 *
	 * @return int|null
	 */
	public function get_order_override(): ?int {

		return $this->order_override;
	}
}