Exemplo n.º 1
0
 public function setValue($value, $refill = false)
 {
     if (is_array($value) && $this->cfg->uniqValue) {
         parent::setValue(array_shift($value));
     } else {
         if (is_array($value)) {
             $value = $this->addNew($value);
         }
         parent::setValue($value);
     }
 }
Exemplo n.º 2
0
 public function setValue($value, $refill = false)
 {
     if ($refill) {
         $vals = http_vars::getInstance()->post($this->name . '_fields');
         $tmpVal = $value;
         $value = array();
         if (is_array($tmpVal)) {
             foreach ($tmpVal as $v) {
                 $curVal = array(db::getCfg('relatedValue') => $v);
                 foreach ($this->cfg->fields as $f) {
                     $curVal[$f['name']] = isset($vals[$v]) && isset($vals[$v][$f['name']]) ? $vals[$v][$f['name']] : null;
                 }
                 $value[] = $curVal;
             }
         }
     }
     parent::setValue($value);
     $this->prepareValuesForValid();
 }