* @package tao */ abstract class tao_helpers_form_elements_MultipleElement extends tao_helpers_form_FormElement { /** @var array */ protected $options = []; /** @var array */ protected $values = []; /** @var array */ private $disabledValues = []; /** @var array */ private $optionAttributes = []; public function addOptionAttribute(string $optionValue, string $attribute, string $attributeValue): void { if (empty($this->optionAttributes[$optionValue])) { $this->optionAttributes[$optionValue] = []; } $this->optionAttributes[$optionValue][$attribute] = $attributeValue; } public function getOptionAttributes(string $optionValue): array { return $this->optionAttributes[$optionValue] ?? []; } /** * Short description of method setOptions * * @access public * @author Bertrand Chevrier, * @param array options * @return void */ public function setOptions(array $options): void { $this->options = $options; } /** * Short description of method getOptions * * @access public * @author Bertrand Chevrier, * @return array */ public function getOptions() { return (array)$this->options; } /** * Short description of method setValue * * @access public * @author Bertrand Chevrier, * @param string $value * @return void */ public function setValue($value) { $this->value = tao_helpers_Uri::encode((string)$value); } /** * Short description of method addValue * * @access public * @author Bertrand Chevrier, * @param string $value * @return void */ public function addValue(string $value): void { $this->values[] = tao_helpers_Uri::encode($value); } /** * Short description of method getValues * * @access public * @author Bertrand Chevrier, * @return array */ public function getValues(): array { return (array)$this->values; } /** * Short description of method setValues * * @access public * @author Bertrand Chevrier, * @param array values * @return mixed */ public function setValues(array $values) { $this->values = $values; } public function getDisabledValues(): array { return $this->disabledValues; } public function setDisabledValues(array $disabledValues): void { $this->disabledValues = $disabledValues; } }