RSVP fromNotice now throws NoResultException

This commit is contained in:
Mikael Nordfeldth 2014-08-05 12:42:30 +02:00
parent e32178d3ce
commit a9676f5b2b
1 changed files with 6 additions and 1 deletions

View 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)