public function testConvertStatusToString() { $code = Api_Bo_Events::getRsvpStatusCode(Api_Bo_Events::RS_FBDB_RSVP_STR_ATTENDING); $this->assertTrue($code == Api_Bo_Events::RS_FBDB_RSVP_ATTENDING, "{$code} does not match " . Api_Bo_Events::RS_FBDB_RSVP_ATTENDING); $code = Api_Bo_Events::getRsvpStatusCode(Api_Bo_Events::RS_FBDB_RSVP_STR_DECLINED); $this->assertTrue($code == Api_Bo_Events::RS_FBDB_RSVP_DECLINED, "{$code} does not match " . Api_Bo_Events::RS_FBDB_RSVP_DECLINED); $code = Api_Bo_Events::getRsvpStatusCode(Api_Bo_Events::RS_FBDB_RSVP_STR_NOT_REPLIED); $this->assertTrue($code == Api_Bo_Events::RS_FBDB_RSVP_NOT_REPLIED, "{$code} does not match " . Api_Bo_Events::RS_FBDB_RSVP_NOT_REPLIED); $code = Api_Bo_Events::getRsvpStatusCode(Api_Bo_Events::RS_FBDB_RSVP_STR_UNSURE); $this->assertTrue($code == Api_Bo_Events::RS_FBDB_RSVP_UNSURE, "{$code} does not match " . Api_Bo_Events::RS_FBDB_RSVP_UNSURE); $code = Api_Bo_Events::getRsvpStatusCode("WRONG"); $this->assertTrue($code == -1, "{$code} does not match " . -1); }
/** * Used to get event members, used by getEvents* calls * * @param unknown_type $uid * @param unknown_type $rsvp * @param unknown_type $eids * @return unknown */ public static function getEventMembersAsArray($uid, $rsvp = null, $eids = null) { $q = Doctrine_Query::create(); $q->select('e.eid')->from('RingsideEventsMember e'); $select_where = "e.uid = {$uid}"; if ($rsvp != null) { $status = Api_Bo_Events::getRsvpStatusCode($rsvp); $select_where .= " and rsvp = {$status}"; } if ($eids != null) { $eids = implode(",", $eids); $select_where .= " and eid in ({$eids})"; } $q->where($select_where); $members = $q->execute(); $eid_array = array(); foreach ($members as $member) { $eid_array[] = $member->eid; } return $eid_array; }