value = $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 */ public function getValue(): string|int { 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; } }