Inherits from NSObject
Conforms to NSURLConnectionDataDelegate
Declared in MMDBFetcher.h
MMDBFetcher.m

Overview

A model for qeurying data from the api.

Class Methods

get

Get a singleton instance of this class. Clients should use this, and not initialize a new instance for every request.

+ (MMDBFetcher *)get

Discussion

NOTE: The idea is to encapsulate request merging in this class, so a singleton will give us significant performance improvements.

Declared In

MMDBFetcher.h

Instance Methods

addMenuRating:

Add a rating/review for a menu item.

- (void)addMenuRating:(MMMenuItemRating *)rating

Declared In

MMDBFetcher.h

addUser:

Add a user to the service.

- (void)addUser:(MMUser *)user

Declared In

MMDBFetcher.h

addUserRestrictions:withRestrictionIDs:

Add all given restrictions for the given user.

- (void)addUserRestrictions:(NSString *)email withRestrictionIDs:(NSArray *)restrictions

Declared In

MMDBFetcher.h

changePasswordForUser:

Changes the user’s password.

- (RACSignal *)changePasswordForUser:(MMUser *)user

Declared In

MMDBFetcher.h

eatenThis:withMenuItem:withMerch:

Checks if the user has already clicked ‘I’ve Eaten this’

- (void)eatenThis:(NSString *)email withMenuItem:(NSNumber *)menuid withMerch:(NSNumber *)merchid

Declared In

MMDBFetcher.h

editReview:

Updates a review.

- (void)editReview:(MMMenuItemRating *)review

Declared In

MMDBFetcher.h

editUser:

Edit the given user’s information on the server.

- (void)editUser:(MMUser *)user

Declared In

MMDBFetcher.h

getAllRestrictions

Get all restrictions that we support.

- (void)getAllRestrictions

Declared In

MMDBFetcher.h

getCategories

Get all merchant categories.

- (void)getCategories

Declared In

MMDBFetcher.h

getCompressedMerchants:

Get all merchants. Only return a subset of the fields to minify data.

- (RACSignal *)getCompressedMerchants:(CLLocation *)usrloc

Declared In

MMDBFetcher.h

getCompressedMerchantsByCuisine:withCuisine:

Get all merchants with category cuisine. Only return a subset of the fields to minify data.

- (RACSignal *)getCompressedMerchantsByCuisine:(CLLocation *)usrloc withCuisine:(NSString *)cuisine

Declared In

MMDBFetcher.h

getCompressedMerchantsByName:withName:

Get all merchants with name = merchname. Only return a subset of the fields to minify data.

- (RACSignal *)getCompressedMerchantsByName:(CLLocation *)usrloc withName:(NSString *)merchname

Declared In

MMDBFetcher.h

getDay:

Get today as a string, e.g. ‘tuesday’

- (NSString *)getDay:(NSDate *)date

Declared In

MMDBFetcher.h

getDessertSpecialsForDate:

Get dessert specials for the given day of the given type.

- (void)getDessertSpecialsForDate:(NSDate *)date

Declared In

MMDBFetcher.h

getDrinkSpecialsForDate:

Get drink specials for the given day of the given type.

- (void)getDrinkSpecialsForDate:(NSDate *)date

Declared In

MMDBFetcher.h

getFoodSpecialsForDate:

Get food specials for the given day of the given type.

- (void)getFoodSpecialsForDate:(NSDate *)date

Declared In

MMDBFetcher.h

getItemRatings:

Get all ratings for a specific meny item with the given menuid

- (void)getItemRatings:(NSNumber *)menuid

Declared In

MMDBFetcher.h

getItemRatingsMerchantRecent:

Get all menu item ratings for a specific merchant.

- (RACSignal *)getItemRatingsMerchantRecent:(NSNumber *)merchid

Declared In

MMDBFetcher.h

getItemRatingsMerchantTop:

Get the top rated (most liked) reviews for a merchant.

- (RACSignal *)getItemRatingsMerchantTop:(NSNumber *)merchid

Declared In

MMDBFetcher.h

getItemRatingsTop:

Get all ratings for a specific item ordered by rating.

- (void)getItemRatingsTop:(NSNumber *)itemid

Declared In

MMDBFetcher.h

getMenuWithMerchantId:withUserEmail:

Get the menu for the restaurant.

- (RACSignal *)getMenuWithMerchantId:(NSNumber *)merchid withUserEmail:(NSString *)email

Declared In

MMDBFetcher.h

getMerchant:

Get all information about the merchant (restaurant) with the given id.

- (RACSignal *)getMerchant:(NSNumber *)merchid

Declared In

MMDBFetcher.h

getModifications:withUser:

Get all modifications for a specific menu item with the given email.

- (void)getModifications:(NSNumber *)menuid withUser:(NSString *)email

Declared In

MMDBFetcher.h

getUser:

Get all information for the user with the given email.

- (void)getUser:(NSString *)email

Declared In

MMDBFetcher.h

getUserRestrictions:

Get all restrictions for the given user.

- (void)getUserRestrictions:(NSString *)email

Declared In

MMDBFetcher.h

likeReview:withMenuItem:withMerch:withReview:

When a user likes a menu item review.

- (void)likeReview:(NSString *)email withMenuItem:(NSNumber *)menuid withMerch:(NSNumber *)merchid withReview:(NSNumber *)rid

Declared In

MMDBFetcher.h

reportReview:withMenuItem:withMerch:withReview:

When a user reports a review they find offensive.

- (void)reportReview:(NSString *)email withMenuItem:(NSNumber *)menuid withMerch:(NSNumber *)merchid withReview:(NSNumber *)rid

Declared In

MMDBFetcher.h

userEaten:withItem:

When a user clicks ‘I’ve Eaten This’.

- (void)userEaten:(NSString *)email withItem:(NSNumber *)mid

Declared In

MMDBFetcher.h

userExists:

Check if the user with this email address exists already.

- (void)userExists:(NSString *)email

Declared In

MMDBFetcher.h

userLiked:withReview:

Checks if the user has already liked a review.

- (void)userLiked:(NSString *)email withReview:(NSNumber *)rid

Declared In

MMDBFetcher.h

userReported:withReview:

Checks if the user has already reported a review.

- (void)userReported:(NSString *)email withReview:(NSNumber *)rid

Declared In

MMDBFetcher.h

userVerified:

Checks if the password for the user is entered correctly (for login).

- (void)userVerified:(MMUser *)user

Declared In

MMDBFetcher.h