RooTrait.php
authoredward <edward@roojs.com>
Wed, 30 Mar 2016 10:25:51 +0000 (18:25 +0800)
committeredward <edward@roojs.com>
Wed, 30 Mar 2016 10:25:51 +0000 (18:25 +0800)
RooTrait.php

index 7b4e40a..26f0fb9 100644 (file)
@@ -134,4 +134,24 @@ trait Pman_Core_RooTrait {
         $this->jerr($out);
         
     }
+    
+    function jok($str)
+    {
+        if ($this->transObj ) {
+            $this->transObj->query( connection_aborted() ? 'ROLLBACK' :  'COMMIT');
+        }
+        
+        return parent::jok($str);
+    }
+    
+    
+    function jerr($str, $errors=array(), $content_type = false)
+    {
+        if ($this->transObj) {
+            $this->transObj->query('ROLLBACK');
+        }
+        
+        return parent::jerr($str,$errors,$content_type);
+    
+    }
 }