]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
GS_DataObject overrides DB_DataObject insert() too
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 6 Jun 2015 17:59:01 +0000 (19:59 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 6 Jun 2015 17:59:01 +0000 (19:59 +0200)
classes/GS_DataObject.php

index 47125f243872f8907ee63f88a8a8d42a5bd61740..2d196026a4af0857bcf181f71cf5f2c9b86efdf1 100644 (file)
@@ -137,6 +137,20 @@ 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)
     {