]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/GS_DataObject.php
Merge commit '5c4a7a10' into nightly
[quix0rs-gnu-social.git] / classes / GS_DataObject.php
index 67f324049324b7affacf3f44c21d43477ef91e46..4ca2436eec8df941c44f141e3becaf8e9fb94350 100644 (file)
@@ -59,7 +59,7 @@ class GS_DataObject extends DB_DataObject
         return $res;
     }
 
-    public function debugLevel($v = null)
+    static public function debugLevel($v = null)
     {
         // avoid those annoying PEAR::DB strict standards warnings it causes
         $old = error_reporting();
@@ -72,7 +72,21 @@ class GS_DataObject extends DB_DataObject
         return $res;
     }
 
-    public function factory($table = '')
+    // delete calls PEAR::isError from DB_DataObject, so let's make that disappear too
+    public function delete($useWhere = false)
+    {
+        // avoid those annoying PEAR::DB strict standards warnings it causes
+        $old = error_reporting();
+        error_reporting(error_reporting() & ~E_STRICT);
+
+        $res = parent::delete($useWhere);
+
+        // reset
+        error_reporting($old);
+        return $res;
+    }
+
+    static public function factory($table = '')
     {
         // avoid those annoying PEAR::DB strict standards warnings it causes
         $old = error_reporting();
@@ -137,6 +151,34 @@ class GS_DataObject extends DB_DataObject
         return $res;
     }
 
+    // insert calls PEAR::isError from DB_DataObject, so let's make that disappear too
+    public function insert()
+    {
+        // avoid those annoying PEAR::DB strict standards warnings it causes
+        $old = error_reporting();
+        error_reporting(error_reporting() & ~E_STRICT);
+
+        $res = parent::insert();
+
+        // reset
+        error_reporting($old);
+        return $res;
+    }
+
+    // DB_DataObject's joinAdd calls DB_DataObject::factory explicitly, so our factory-override doesn't work
+    public function joinAdd($obj = false, $joinType='INNER', $joinAs=false, $joinCol=false)
+    {
+        // avoid those annoying PEAR::DB strict standards warnings it causes
+        $old = error_reporting();
+        error_reporting(error_reporting() & ~E_STRICT);
+
+        $res = parent::joinAdd($obj, $joinType, $joinAs, $joinCol);
+
+        // reset
+        error_reporting($old);
+        return $res;
+    }
+
     public function links()
     {
         // avoid those annoying PEAR::DB strict standards warnings it causes
@@ -164,7 +206,7 @@ class GS_DataObject extends DB_DataObject
         return $res;
     }
 
-    public function staticGet($class, $k, $v = null)
+    static public function staticGet($class, $k, $v = null)
     {
         // avoid those annoying PEAR::DB strict standards warnings it causes
         $old = error_reporting();