public $seqid; // int(11) not_null multiple_key
public $seqmax; // int(11) not_null multiple_key
public $display_name;
-
+ public $is_system_enum;
+
+
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
function lookupCreate($etype,$name, $display_name=false) {
+ static $cache = array();
+ $ckey = json_encode(array($etype, $name));
+ if (isset($cache[$ckey])) {
+ return $cache[$ckey];
+ }
+
// check
$ce = DB_DataObject::Factory('core_enum');
$ce->setFrom(array(
$ce->etype = $etype;
$ce->name = $name;
if ($ce->find(true)) {
+ $cache[$ckey] = $ce->id;
return $ce->id;
}
$ce->active = 1;
$ce->display_name = $display_name === false ? $ce->name : $display_name;
- return $ce->insert();
+ $ret = $ce->insert();
+ $cache[$ckey] = $ret;
+ return $ret;
}
if (empty($t->name) && $t->name != 0) {
print_R($data);
- die("ERROR: invalid name used for core_enum\n\n");
+ die("ERROR: invalid name used for core_enum\n\n" );
}
if (!$t->count()) {