Exemple #1
0
 protected function processInsertField(&$dbFields, $field)
 {
     $name = $field[0];
     $isUpdate = true;
     if (isset($field['isFieldDb'])) {
         if ($field['isFieldDb'] == false) {
             $isUpdate = false;
         }
     }
     if ($isUpdate) {
         if (isset($field['widget'])) {
             $class = $field['widget'][0];
             if (method_exists($class, 'onInsert')) {
                 $new = $class::onInsert($field, $this);
                 foreach ($new as $k => $v) {
                     $dbFields[$k] = $v;
                 }
             }
             return;
         }
         if (self::getType($field) == 'place') {
             $new = Place::onUpdate($field, $this);
             foreach ($new as $k => $v) {
                 $dbFields[$k] = $v;
             }
             return;
         }
         if (self::getType($field) == 'RadioList') {
             $new = RadioList::onUpdate($field, $this);
             foreach ($new as $k => $v) {
                 $dbFields[$k] = $v;
             }
             return;
         }
         $value = $this->{$name};
         $value = $this->updateGetValue($value, $field);
         $dbFields[$name] = $value;
     }
 }