function saveNew($profile, $event, $verb, $options = array()) { $eventNotice = $event->getNotice(); $options = array_merge(array('source' => 'web'), $options); $act = new Activity(); $act->type = ActivityObject::ACTIVITY; $act->verb = $verb; $act->time = $options['created'] ? strtotime($options['created']) : time(); $act->title = _m("RSVP"); $act->actor = $profile->asActivityObject(); $act->target = $eventNotice->asActivityObject(); $act->objects = array(clone $act->target); $act->content = RSVP::toHTML($profile, $event, self::codeFor($verb)); $act->id = common_local_url('showrsvp', array('id' => UUID::gen())); $act->link = $act->id; $saved = Notice::saveActivity($act, $profile, $options); return $saved; }