]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
RSVP fromNotice now throws NoResultException
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 5 Aug 2014 10:42:30 +0000 (12:42 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 6 Aug 2014 07:23:42 +0000 (09:23 +0200)
plugins/Event/classes/RSVP.php

index 31ccf439ef9ac0812b4123ffa6d9208ddd4003f5..de3307fad4e4352ef6ca1c4bc3cfbc967e6e00e0 100644 (file)
@@ -226,7 +226,12 @@ class RSVP extends Managed_DataObject
 
     static function fromNotice(Notice $notice)
     {
-        return RSVP::getKV('uri', $notice->uri);
+        $rsvp = new RSVP();
+        $rsvp->uri = $notice->uri;
+        if (!$rsvp->find(true)) {
+            throw new NoResultException($rsvp);
+        }
+        return $rsvp;
     }
 
     static function forEvent(Happening $event)