]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Fave.php
Add check after oembed API call. In case of error, returned value is false which...
[quix0rs-gnu-social.git] / classes / Fave.php
index 9a14036cae7fb14dcacff68d72e111bc4028840a..beeda9aafd314795414ad8c51712de94c2f03a46 100644 (file)
@@ -78,16 +78,16 @@ class Fave extends Managed_DataObject
         return $fave;
     }
 
-    function delete()
+    function delete($useWhere=false)
     {
-        $profile = Profile::staticGet('id', $this->user_id);
-        $notice  = Notice::staticGet('id', $this->notice_id);
+        $profile = Profile::getKV('id', $this->user_id);
+        $notice  = Notice::getKV('id', $this->notice_id);
 
         $result = null;
 
         if (Event::handle('StartDisfavorNotice', array($profile, $notice, &$result))) {
 
-            $result = parent::delete();
+            $result = parent::delete($useWhere);
             self::blow('fave:list-ids:notice_id:%d', $this->notice_id);
             self::blow('popular');
 
@@ -99,11 +99,6 @@ class Fave extends Managed_DataObject
         return $result;
     }
 
-    function pkeyGet($kv)
-    {
-        return Memcached_DataObject::pkeyGet('Fave', $kv);
-    }
-
     function stream($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $own=false, $since_id=0, $max_id=0)
     {
         $stream = new FaveNoticeStream($user_id, $own);
@@ -120,13 +115,13 @@ class Fave extends Managed_DataObject
 
     function asActivity()
     {
-        $notice = Notice::staticGet('id', $this->notice_id);
+        $notice = Notice::getKV('id', $this->notice_id);
 
         if (!$notice) {
             throw new Exception("Fave for non-existent notice: " . $this->notice_id);
         }
 
-        $profile = Profile::staticGet('id', $this->user_id);
+        $profile = Profile::getKV('id', $this->user_id);
 
         if (!$profile) {
             throw new Exception("Fave by non-existent profile: " . $this->user_id);