function filter($notice) { if (!parent::filter($notice)) { // if not in our scope, return false return false; } if (empty($this->rsvp)) { // Don't filter on RSVP (for only events with RSVP if no responses // are given (give ['Y', 'N', '?'] for only RSVP'd events!). return true; } $rsvp = new RSVP(); $rsvp->profile_id = $this->target->getID(); $rsvp->event_uri = $notice->getUri(); $rsvp->whereAddIn('response', $this->rsvp, $rsvp->columnType('response')); // filter out if no RSVP match was found return $rsvp->N > 0; }