예제 #1
0
 function __create($data)
 {
     $instance = parent::create($data);
     $instance->save();
     return $instance;
 }
예제 #2
0
 static function create($ht)
 {
     if (!isset($ht['mode'])) {
         $ht['mode'] = 1;
     }
     $ht['created'] = new SqlFunction('NOW');
     return parent::create($ht);
 }
예제 #3
0
 static function create($ht = false)
 {
     $inst = parent::create($ht);
     $inst->set('created', new SqlFunction('NOW'));
     return $inst;
 }
 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;
 }