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