acceptedValues = $acceptedValues; } /** * Check if field value is valid. * Value is valid if it is empty and optional or is in the set of accepted values. * @return boolean */ function isValid() { return $this->isEmptyAndOptional() || in_array($this->form->getData($this->field), $this->acceptedValues); } } ?>