static function create($ht = false) { $inst = parent::create($ht); $inst->set('created', new SqlFunction('NOW')); foreach ($inst->getForm()->getFields() as $f) { if (!$f->hasData()) { continue; } $a = DynamicFormEntryAnswer::create(array('field_id' => $f->get('id'))); $a->field = $f; $a->field->setAnswer($a); $a->entry = $inst; $inst->_values[] = $a; } return $inst; }