Exemple #1
0
 /**
  * Mark notification tray notifications as read up, to a certain timestamp.
  * 
  * @param string|integer|null The timestamp of the most recent notification that the user viewed.
  * @return array
  */
 public function markAsRead($highWatermark)
 {
     //argument 1 must be a string, integer or null
     Eden_Foursquare_Error::i()->argument(1, 'string', 'int', 'null');
     $this->_query['highWatermark'] = strtotime($highWatermark);
     return $this->_post(self::URL_UPDATES_MARK_AS_READ, $this->_query);
 }
Exemple #2
0
 public function __construct($clientId, $clientSecret, $redirect)
 {
     //argument test
     Eden_Foursquare_Error::i()->argument(1, 'string')->argument(2, 'string')->argument(3, 'string');
     //Argument 4 must be a string
     parent::__construct($clientId, $clientSecret, $redirect, self::REQUEST_URL, self::ACCESS_URL);
 }
 /**
  * Mark notification tray notifications as read up, to a certain timestamp.
  * 
  * @param string|integer The timestamp of the most recent notification that the user viewed.
  * @return array
  */
 public function markAsRead($highWatermark)
 {
     //argument 1 must be a string or integer
     Eden_Foursquare_Error::i()->argument(1, 'string', 'int');
     $highWatermark = strtotime($highWatermark);
     $query = array('highWatermark' => $highWatermark);
     //optional
     return $this->_post(self::URL_UPDATES_MARK_AS_READ, $query);
 }
 /**
  * Change a setting for the given user.
  * 
  * @param string Name of setting to change, sendToTwitter,  
  * sendMayorshipsToTwitter, sendBadgesToTwitter, sendToFacebook, 
  * sendMayorshipsToFacebook, sendBadgesToFacebook, receivePings, receiveCommentPings.
  * @param integer 1 for true, and 0 for false.
  * @return array
  */
 public function changeSettings($settingId, $value)
 {
     //argument test
     Eden_Foursquare_Error::i()->argument(1, 'string')->argument(2, 'int');
     //argument 2 must be a integer
     //if the input value is not allowed
     if (!in_array($settingId, array('sendToTwitter', 'sendMayorshipsToTwitter', 'sendBadgesToTwitter', 'sendToFacebook', 'sendMayorshipsToFacebook', 'sendBadgesToFacebook', 'receivePings', 'receiveCommentPings'))) {
         //throw error
         Eden_Foursquare_Error::i()->setMessage(Eden_Foursquare_Error::INVALID_SETTING)->addVariable($settingId)->trigger();
     }
     $query = array('SETTING_ID' => $settingId, 'value' => $value);
     return $this->_post(sprintf(self::URL_SETTINGS_CHANGE, $settingId), $query);
 }
Exemple #5
0
 /**
  * Returns foursquare venueGroups
  *
  * @param *string
  * @return Eden_Foursquare_Venuegroups
  */
 public function venueGroups($token)
 {
     //Argument 1 must be a string
     Eden_Foursquare_Error::i()->argument(1, 'string');
     return Eden_Foursquare_Venuegroups::i($token);
 }
Exemple #6
0
 /**
  * Start a campaign.
  *  
  * @param string The ID of the campaign to start.
  * @return array
  */
 public function startCampaign($campaignId)
 {
     //argument 1 must be a string
     Eden_Foursquare_Error::i()->argument(1, 'string');
     return $this->_post(sprintf(self::URL_CAMPAIGN_START, $campaignId), $this->_query);
 }
Exemple #7
0
 public function __construct($token)
 {
     //argument test
     Eden_Foursquare_Error::i()->argument(1, 'string');
     $this->_token = $token;
 }
 /**
  * Make changes to a venue
  * 
  * @param string The venue id to edit
  * @return array
  */
 public function proposeEdit($venueId)
 {
     //argument 1 must be a string
     Eden_Foursquare_Error::i()->argument(1, 'string');
     //populate fields
     $query = array('VENUE_ID' => $venueId, 'name' => $this->_name, 'address' => $this->_address, 'crossStreet' => $this->_crossStreet, 'city' => $this->_city, 'state' => $this->_state, 'zip' => $this->_zip, 'phone' => $this->_phone, 'll	' => $this->_location, 'primaryCategoryId' => $this->_primaryCategoryId);
     //optional
     return $this->_post(sprintf(self::URL_VENUE_PROPOSE_EDIT, $venueId), $query);
 }
 /**
  * Retire a special. Retired specials will not show up in the list 
  * of specials and cannot be assigned to a group. Also ends any 
  * active campaigns associated with the special.
  *  
  * @param string The ID of the special to retire
  * @return array
  */
 public function retire($specialId)
 {
     //argument 1 must be a string
     Eden_Foursquare_Error::i()->argument(1, 'string');
     return $this->_post(sprintf(self::URL_SPECIAL_RETIRE, $specialId));
 }
Exemple #10
0
 /**
  * Make changes to a venue
  * 
  * @param string The venue id to edit
  * @return array
  */
 public function proposeEdit($venueId)
 {
     //argument 1 must be a string
     Eden_Foursquare_Error::i()->argument(1, 'string');
     $this->_query['VENUE_ID'] = $venueId;
     return $this->_post(sprintf(self::URL_VENUE_PROPOSE_EDIT, $venueId), $this->_query);
 }
Exemple #11
0
 /**
  * Updates a venue group
  * 
  * @param string The ID of the venue group to modify
  * @param string Venue ID that will become the new set of venue IDs for the group.
  * @param string The new name to give to the group.
  * @return array
  */
 public function updateVenueGroup($groupId, $venueId, $name)
 {
     //argument test
     Eden_Foursquare_Error::i()->argument(1, 'string')->argument(2, 'string')->argument(3, 'string');
     //argument 3 must be a string
     $this->_query['venueId'] = $venueId;
     $this->_query['name'] = $name;
     return $this->_post(sprintf(self::URL_VENUE_GROUPS_UPDATE, $groupId), $this->_query);
 }
 /**
  * Approves a pending friend request from another user. 
  * 
  * @param string The user ID of a pending friend.
  * @return array
  */
 public function approveRequest($userId)
 {
     //argument 1 must be a string
     Eden_Foursquare_Error::i()->argument(1, 'string');
     //populate fields
     $query = array('USER_ID' => $userId);
     return $this->_post(self::URL_USERS_APPROVE_REQUEST, $query);
 }
Exemple #13
0
 /**
  * Causes the current user to 'like' a page update. 
  * If there is a campaign associated with the update, 
  * the like will propagate to the special as well.
  *  
  * @param string The ID of the update to like.
  * @return array
  */
 public function like($pageId)
 {
     //argument test
     Eden_Foursquare_Error::i()->argument(1, 'string');
     return $this->_getResponse(sprintf(self::URL_PAGEUPDATES_LIKE, $pageId));
 }
Exemple #14
0
 /**
  * Reply to a user about their check-in. This reply will only be visible to the owner of the check-in.  
  * 
  * @param string The ID of the checkin to remove a comment from.
  * @param string The id of the comment to remove.
  * @return array
  */
 public function replyToCheckin($checkinId, $text)
 {
     //argument test
     Eden_Foursquare_Error::i()->argument(1, 'string')->argument(2, 'string');
     //argument 2 must be a string
     $this->_query['text'] = $text;
     return $this->_post(sprintf(self::URL_CHECKINS_REPLY, $checkinId), $this->_query);
 }
 /**
  * Allows you to get the page's venues.
  *  
  * @param string The page id for which venues are being requested.
  * @return array
  */
 public function getVenue($pageId)
 {
     //argument 1 must be a string
     Eden_Foursquare_Error::i()->argument(1, 'string');
     $query = array('ll' => $this->_location, 'radius' => $this->_radius, 'offset' => $this->_offset, 'limit' => $this->_limit);
     //optional
     return $this->_getResponse(sprintf(self::URL_PAGES_VENUES, $pageId), $query);
 }
 /**
  * Reply to a user about their check-in. This reply will only be visible to the owner of the check-in.  
  * 
  * @param string The ID of the checkin to remove a comment from.
  * @param string The id of the comment to remove.
  * @return array
  */
 public function replyToCheckin($checkinId, $text)
 {
     //argument test
     Eden_Foursquare_Error::i()->argument(1, 'string')->argument(2, 'string');
     //argument 2 must be a string
     //populate fiels
     $query = array('text' => $text, 'url' => $this->_url, 'contentId' => $this->_contentId);
     //optional
     return $this->_post(sprintf(self::URL_CHECKINS_REPLY, $checkinId), $query);
 }
Exemple #17
0
 /**
  * Share a user-created list to twitter or facebook. 
  * 
  * @param string Id for a user-created list 
  * @return array
  */
 public function shareList($listId)
 {
     //argument test
     Eden_Foursquare_Error::i()->argument(1, 'string');
     $this->_query['itemId'] = $itemId;
     return $this->_post(sprintf(self::URL_LIST_SHARE, $listId), $this->_query);
 }
 /**
  * Share a user-created list to twitter or facebook. 
  * 
  * @param string Id for a user-created list 
  * @return array
  */
 public function shareList($listId)
 {
     //argument test
     Eden_Foursquare_Error::i()->argument(1, 'string');
     //populate fields
     $query = array('itemId' => $itemId, 'broadcast' => $this->_broadcast, 'message' => $this->_message);
     //optional
     return $this->_post(sprintf(self::URL_LIST_SHARE, $listId), $query);
 }
Exemple #19
0
 /**
  * Approves a pending friend request from another user. 
  * 
  * @param string The user ID of a pending friend.
  * @return array
  */
 public function approveRequest($userId)
 {
     //argument 1 must be a string
     Eden_Foursquare_Error::i()->argument(1, 'string');
     $this->_query['USER_ID'] = $userId;
     return $this->_post(self::URL_USERS_APPROVE_REQUEST, $this->_query);
 }
 /**
  * Allows you to remove a tip from your to-do list or done list. 
  * 
  * @param string The tip you want to mark done.
  * @return array
  */
 public function unmark($tipId)
 {
     //argument 1 must be a string
     Eden_Foursquare_Error::i()->argument(1, 'string');
     return $this->_post(sprintf(self::URL_TIPS_UNMARK, $tipId));
 }
 /**
  * Start a campaign.
  *  
  * @param string The ID of the campaign to start.
  * @return array
  */
 public function startCampaign($campaignId)
 {
     //argument 1 must be a string
     Eden_Foursquare_Error::i()->argument(1, 'string');
     //populate fields
     $query = array('startAt' => $this->_startAt);
     //optional
     return $this->_post(sprintf(self::URL_CAMPAIGN_START, $campaignId), $query);
 }
Exemple #22
0
 /**
  * Allows you to get the page's venues.
  *  
  * @param string The page id for which venues are being requested.
  * @return array
  */
 public function getVenue($pageId)
 {
     //argument 1 must be a string
     Eden_Foursquare_Error::i()->argument(1, 'string');
     return $this->_getResponse(sprintf(self::URL_PAGES_VENUES, $pageId), $this->_query);
 }
Exemple #23
0
 /**
  * Get details of a photo.
  * 
  * @param string The ID of the photo to retrieve additional information for.
  * @return array
  */
 public function getDetail($photoId)
 {
     //argument 1 must be a string
     Eden_Foursquare_Error::i()->argument(1, 'string');
     return $this->_getResponse(sprintf(self::URL_PHOTOS_GET, $photoId));
 }