From 4ce65d59ca91871cfd126497158200a818720bce Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 13:30:08 +0200 Subject: Adding upstream version 0.13.1. Signed-off-by: Daniel Baumann --- vendor/ipl/html/src/FormElement/RadioOption.php | 148 ++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 vendor/ipl/html/src/FormElement/RadioOption.php (limited to 'vendor/ipl/html/src/FormElement/RadioOption.php') diff --git a/vendor/ipl/html/src/FormElement/RadioOption.php b/vendor/ipl/html/src/FormElement/RadioOption.php new file mode 100644 index 0000000..4968c35 --- /dev/null +++ b/vendor/ipl/html/src/FormElement/RadioOption.php @@ -0,0 +1,148 @@ +value = $value === '' ? null : $value; + $this->label = $label; + } + + /** + * Set the label of the option + * + * @param string $label + * + * @return $this + */ + public function setLabel(string $label): self + { + $this->label = $label; + + return $this; + } + + /** + * Get the label of the option + * + * @return string + */ + public function getLabel(): string + { + return $this->label; + } + + /** + * Get the value of the option + * + * @return string|int|null + */ + public function getValue() + { + return $this->value; + } + + /** + * Set css class to the option label + * + * @param string|string[] $labelCssClass + * + * @return $this + */ + public function setLabelCssClass($labelCssClass): self + { + $this->labelCssClass = $labelCssClass; + + return $this; + } + + /** + * Get css class of the option label + * + * @return string|string[] + */ + public function getLabelCssClass() + { + return $this->labelCssClass; + } + + /** + * Set whether to disable the option + * + * @param bool $disabled + * + * @return $this + */ + public function setDisabled(bool $disabled = true): self + { + $this->disabled = $disabled; + + return $this; + } + + /** + * Get whether the option is disabled + * + * @return bool + */ + public function isDisabled(): bool + { + return $this->disabled; + } + + /** + * Add the attributes + * + * @param Attributes $attributes + * + * @return $this + */ + public function addAttributes(Attributes $attributes): self + { + $this->attributes = $attributes; + + return $this; + } + + /** + * Get the attributes + * + * @return Attributes + */ + public function getAttributes(): Attributes + { + if ($this->attributes === null) { + $this->attributes = new Attributes(); + } + + return $this->attributes; + } +} -- cgit v1.2.3