DataObjects/Core_enum.php
authorAlan Knowles <alan@roojs.com>
Sat, 28 Jan 2012 08:33:12 +0000 (16:33 +0800)
committerAlan Knowles <alan@roojs.com>
Sat, 28 Jan 2012 08:33:12 +0000 (16:33 +0800)
DataObjects/Core_enum.php

index 2610941..54d610f 100644 (file)
@@ -27,4 +27,15 @@ 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) ."')");
+        }
+        
+    }
+    
 }