public function val($value = null)
{
if ($value === null) {
return $this->value;
}
$value_exists = $this->setValueInOptGroups($value);
if ($value_exists) {
$this->value = $value;
} else {
// unknown value set, select first option instead
$this->value = $this->getFirstOption();
$this->setValueInOptGroups($this->value);
}
return $this;
}