Exemplo n.º 1
0
 /**
  * Execute the groups.get method
  *  
  */
 public function execute()
 {
     $em = Api_Bo_Events::getMembers($this->getUserId(), $this->m_eid);
     $response = array();
     if (count($em) > 0) {
         $response[FB_EVENTS_MEMBERS_ATTENDING]['uid'] = array();
         $response[FB_EVENTS_MEMBERS_UNSURE]['uid'] = array();
         $response[FB_EVENTS_MEMBERS_DECLINED]['uid'] = array();
         $response[FB_EVENTS_MEMBERS_NOT_REPLIED]['uid'] = array();
         foreach ($em as $mem) {
             switch ($mem['rsvp']) {
                 case Api_Bo_Events::RS_FBDB_RSVP_ATTENDING:
                     $response[FB_EVENTS_MEMBERS_ATTENDING]['uid'][] = $mem['uid'];
                     break;
                 case Api_Bo_Events::RS_FBDB_RSVP_DECLINED:
                     $response[FB_EVENTS_MEMBERS_DECLINED]['uid'][] = $mem['uid'];
                     break;
                 case Api_Bo_Events::RS_FBDB_RSVP_NOT_REPLIED:
                     $response[FB_EVENTS_MEMBERS_NOT_REPLIED]['uid'][] = $mem['uid'];
                     break;
                 case Api_Bo_Events::RS_FBDB_RSVP_UNSURE:
                     $response[FB_EVENTS_MEMBERS_UNSURE]['uid'][] = $mem['uid'];
                     break;
             }
         }
     }
     return $response;
 }
Exemplo n.º 2
0
 public function testConvertStatusToCode()
 {
     $code = Api_Bo_Events::getRsvpStatusString(Api_Bo_Events::RS_FBDB_RSVP_ATTENDING);
     $this->assertTrue($code == Api_Bo_Events::RS_FBDB_RSVP_STR_ATTENDING, "{$code} does not match " . Api_Bo_Events::RS_FBDB_RSVP_STR_ATTENDING);
     $code = Api_Bo_Events::getRsvpStatusString(Api_Bo_Events::RS_FBDB_RSVP_DECLINED);
     $this->assertTrue($code == Api_Bo_Events::RS_FBDB_RSVP_STR_DECLINED, "{$code} does not match " . Api_Bo_Events::RS_FBDB_RSVP_STR_DECLINED);
     $code = Api_Bo_Events::getRsvpStatusString(Api_Bo_Events::RS_FBDB_RSVP_NOT_REPLIED);
     $this->assertTrue($code == Api_Bo_Events::RS_FBDB_RSVP_STR_NOT_REPLIED, "{$code} does not match " . Api_Bo_Events::RS_FBDB_RSVP_STR_NOT_REPLIED);
     $code = Api_Bo_Events::getRsvpStatusString(Api_Bo_Events::RS_FBDB_RSVP_UNSURE);
     $this->assertTrue($code == Api_Bo_Events::RS_FBDB_RSVP_STR_UNSURE, "{$code} does not match " . Api_Bo_Events::RS_FBDB_RSVP_STR_UNSURE);
 }
Exemplo n.º 3
0
 public function execute()
 {
     $events = Api_Bo_Events::getEvents($this->getUserId(), $this->m_uid, $this->m_start_time, $this->m_end_time, $this->m_eids, $this->m_rsvp_status);
     $response = array();
     if (!empty($events)) {
         $response[FB_EVENTS_EVENT] = array();
         foreach ($events as $event) {
             $venue = array(FB_EVENTS_STREET => $event['street'], FB_EVENTS_CITY => $event['city'], FB_EVENTS_STATE => $event['state'], FB_EVENTS_COUNTRY => $event['country'], FB_EVENTS_LATITUDE => '', FB_EVENTS_LONGITUDE => '');
             $response[FB_EVENTS_EVENT][] = array(FB_EVENTS_EID => $event['eid'], FB_EVENTS_NAME => $event['name'], FB_EVENTS_TAGLINE => $event['tagline'], FB_EVENTS_NID => $event['nid'], FB_EVENTS_PIC => $event['pic'], FB_EVENTS_PIC_BIG => $event['pic'], FB_EVENTS_PIC_SMALL => $event['pic'], FB_EVENTS_HOST => $event['host'], FB_EVENTS_DESCRIPTION => $event['description'], FB_EVENTS_EVENT_TYPE => $event['event_type'], FB_EVENTS_EVENT_SUBTYPE => $event['event_subtype'], FB_EVENTS_START_TIME => $event['start_time'], FB_EVENTS_END_TIME => $event['end_time'], FB_EVENTS_CREATOR => $event['uid'], FB_EVENTS_MODIFIED => $event['modified'], FB_EVENTS_LOCATION => $event['location'], FB_EVENTS_VENUE => $venue);
         }
     }
     return $response;
 }
Exemplo n.º 4
0
 /**
  * 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;
 }