3 * Table Definition for core company
5 require_once 'DB/DataObject.php';
7 class Pman_Core_DataObjects_Core_enum extends DB_DataObject
10 /* the code below is auto generated do not remove the above tag */
12 public $__table = 'core_enum'; // table name
13 public $id; // int(11) not_null primary_key auto_increment
14 public $etype; // string(32) not_null
15 public $name; // string(255) not_null
16 public $active; // int(2) not_null
17 public $seqid; // int(11) not_null multiple_key
18 public $seqmax; // int(11) not_null multiple_key
21 /* the code above is auto generated do not remove the tag below */
23 function applyFilters($q, $au)
26 //DB_DataObject::debugLevel(1);
27 if (!empty($q['query']['empty_etype'])) {
28 $this->whereAdd("etype = ''");
32 function onUpdate($old, $req)
34 $x = $this->factory($this->tableName());
35 $x->query("SELECT core_enum_seqmax_update('". $this->escape($this->etype) ."')");
36 if ($old->etype != $this->etype) {
37 $x->query("SELECT core_enum_seqmax_update('". $this->escape($old->etype) ."')");
42 function onInsert($req)
44 $x = $this->factory($this->tableName());
45 $x->query("SELECT core_enum_seqmax_update('". $this->escape($this->etype) ."')");
49 function lookup($etype,$name) {
50 $ce = DB_DataObject::Factory('core_enum');
53 if ($ce->find(true)) {
60 function lookupObject($etype,$name, $create= false)
63 static $cache = array();
64 $key = "$etype:$name";
65 if (isset($cache[$key]) ) {
68 $ce = DB_DataObject::Factory('core_enum');
71 if ($ce->find(true)) {