]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fave insert logging directly in insert()
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 3 Feb 2015 13:58:22 +0000 (14:58 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 3 Feb 2015 13:58:22 +0000 (14:58 +0100)
plugins/Favorite/classes/Fave.php

index 2e60defa4f9f9ad2761f3c71caf5f0cc874d603b..e1f70a797810b705ce381b3f523bfa3db0328812 100644 (file)
@@ -63,12 +63,9 @@ class Fave extends Managed_DataObject
                                             $notice,
                                             $fave->created);
 
-            try {
-                $fave->insert();
-            } catch (ServerException $e) {
-                common_log_db_error($fave, 'INSERT', __FILE__);
-                throw $e;
-            }
+            // throws exception (Fave specific until migrated into Managed_DataObject
+            $fave->insert();
+
             self::blowCacheForProfileId($fave->user_id);
             self::blowCacheForNoticeId($fave->notice_id);
             self::blow('popular');
@@ -82,7 +79,8 @@ class Fave extends Managed_DataObject
     // exception throwing takeover!
     public function insert()
     {
-        if (!parent::insert()) {
+        if (parent::insert()===false) {
+            common_log_db_error($this, 'INSERT', __FILE__);
             throw new ServerException(sprintf(_m('Could not store new object of type %s'), get_called_class()));
         }
         self::blowCacheForProfileId($this->user_id);