]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Subscription_queue.php
case insensitive indexing for content and nick/fullnames (search)
[quix0rs-gnu-social.git] / classes / Subscription_queue.php
index 02cc72f1f24c82b32e6f3085b55c4a7c81cebe60..878fcf5796968028b7464b441a00aeb9e1eaf2a2 100644 (file)
@@ -54,6 +54,18 @@ class Subscription_queue extends Managed_DataObject
         return ($sub instanceof Subscription_queue);
     }
 
+    static function getSubQueue(Profile $subscriber, Profile $other)
+    {
+        // This is essentially a pkeyGet but we have an object to return in NoResultException
+        $sub = new Subscription_queue();
+        $sub->subscriber = $subscriber->id;
+        $sub->subscribed = $other->id;
+        if (!$sub->find(true)) {
+            throw new NoResultException($sub);
+        }
+        return $sub;
+    }
+
     /**
      * Complete a pending subscription, as we've got approval of some sort.
      *