DataObjects/Core_notify_recur.php
[Pman.Core] / DataObjects / Core_enum.php
index 2610941..b6d1c39 100644 (file)
@@ -15,6 +15,7 @@ class Pman_Core_DataObjects_Core_enum extends DB_DataObject
     public $name;                            // string(255)  not_null
     public $active;                          // int(2)  not_null
     public $seqid;                           // int(11)  not_null multiple_key
+    public $seqmax;                           // int(11)  not_null multiple_key
 
     
     /* the code above is auto generated do not remove the tag below */
@@ -27,4 +28,22 @@ class Pman_Core_DataObjects_Core_enum extends DB_DataObject
             $this->whereAdd("etype = ''");
         }
     }
+    
+    function onUpdate($old, $req)
+    {
+        $x = $this->factory($this->tableName());
+        $x->query("SELECT core_enum_seqmax_update('". $this->escape($this->etype) ."')");
+        if ($old->etype != $this->etype) {
+            $x->query("SELECT core_enum_seqmax_update('". $this->escape($old->etype) ."')");
+        }
+        
+    }
+    
+    function onInsert($req)
+    {
+        $x = $this->factory($this->tableName());
+        $x->query("SELECT core_enum_seqmax_update('". $this->escape($this->etype) ."')");
+         
+    }
+    
 }