protected function updateValue() { if (!$this->getAttribute('multiple')) { parent::updateValue(); } else { $name = $this->getName(); foreach ($this->getDataSources() as $ds) { if (null !== ($value = $ds->getValue($name)) || $ds instanceof HTML_QuickForm2_DataSource_Submit) { $this->setValue(null === $value ? array() : $value); return; } } } }
public function updateValue() { $this->elText->setContainer($this->getContainer()); $this->elText->updateValue(); $this->elSelect->setContainer($this->getContainer()); $this->elSelect->updateValue(); $this->elCheckbox->setContainer($this->getContainer()); $this->elCheckbox->updateValue(); parent::updateValue(); }
protected function updateValue() { if (!$this->getAttribute('multiple')) { parent::updateValue(); } else { $name = $this->getName(); /* @var $ds HTML_QuickForm2_DataSource_NullAware */ foreach ($this->getDataSources() as $ds) { if (null !== ($value = $ds->getValue($name)) || $ds instanceof HTML_QuickForm2_DataSource_Submit || $ds instanceof HTML_QuickForm2_DataSource_NullAware && $ds->hasValue($name)) { $this->setValue((array) $value); return; } } } }