コード例 #1
0
 protected function updateValue()
 {
     $name = $this->getName();
     foreach ($this->getDataSources() as $ds) {
         if (null !== ($value = $ds->getValue($name))) {
             $this->setValue($value);
             return;
         }
     }
     return parent::updateValue();
 }
コード例 #2
0
 /**
  * Called when the element needs to update its value from form's data sources
  *
  * Since the date element also accepts a timestamp as value, the default
  * group behavior is changed.
  */
 protected function updateValue()
 {
     $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_NullAware && $ds->hasValue($name)) {
             $this->setValue($value);
             return;
         }
     }
     parent::updateValue();
 }