예제 #1
0
 function __create($data)
 {
     $instance = parent::create($data);
     $instance->save();
     return $instance;
 }
예제 #2
0
 static function create($ht = false)
 {
     $inst = parent::create($ht);
     $inst->set('created', new SqlFunction('NOW'));
     return $inst;
 }
예제 #3
0
 static function lookup($var, $list = false)
 {
     if (!($item = parent::lookup($var))) {
         return null;
     }
     $item->_list = $list;
     return $item;
 }
 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;
 }
예제 #5
0
 function delete()
 {
     if (!parent::delete()) {
         return false;
     }
     // Allow the field to cleanup anything else in the database
     $this->getField()->db_cleanup();
     return true;
 }
예제 #6
0
 static function objects()
 {
     $qs = parent::objects();
     #$qs->select_related('default_email');
     return $qs;
 }