function __create($data) { $instance = parent::create($data); $instance->save(); return $instance; }
static function create($ht) { if (!isset($ht['mode'])) { $ht['mode'] = 1; } $ht['created'] = new SqlFunction('NOW'); return parent::create($ht); }
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; }