From: Mikael Nordfeldth Date: Tue, 5 Aug 2014 10:42:30 +0000 (+0200) Subject: RSVP fromNotice now throws NoResultException X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a9676f5b2b8653baecf70a3436152aff98d9d7c0;p=quix0rs-gnu-social.git RSVP fromNotice now throws NoResultException --- diff --git a/plugins/Event/classes/RSVP.php b/plugins/Event/classes/RSVP.php index 31ccf439ef..de3307fad4 100644 --- a/plugins/Event/classes/RSVP.php +++ b/plugins/Event/classes/RSVP.php @@ -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)