DataObjects/Core_watch.php
[Pman.Core] / DataObjects / Core_enum.php
1 <?php
2 /**
3  * Table Definition for core company
4  */
5 require_once 'DB/DataObject.php';
6
7 class Pman_Core_DataObjects_Core_enum extends DB_DataObject 
8 {
9     ###START_AUTOCODE
10     /* the code below is auto generated do not remove the above tag */
11
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
19     public $display_name;
20     
21     /* the code above is auto generated do not remove the tag below */
22     ###END_AUTOCODE
23     function applyFilters($q, $au)
24     {
25         
26         //DB_DataObject::debugLevel(1);
27         if (!empty($q['query']['empty_etype'])) {
28             $this->whereAdd("etype = ''");
29         }
30     }
31     
32     function onUpdate($old, $req)
33     {
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) ."')");
38         }
39         
40     }
41     
42     function onInsert($req)
43     {
44         $x = $this->factory($this->tableName());
45         $x->query("SELECT core_enum_seqmax_update('". $this->escape($this->etype) ."')");
46          
47     }
48     
49 }