Skip to content

Commit

Permalink
Closes #9. Complete implementation / conversion to Promise style API.
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavin001 committed Jul 16, 2014
1 parent dd85ce2 commit 7ae4067
Show file tree
Hide file tree
Showing 4 changed files with 259 additions and 256 deletions.
11 changes: 6 additions & 5 deletions Common/SLModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#import "CoreData+MagicalRecord.h"
#import "SLObject.h"
#import "SLValue.h"
#import <PromiseKit.h>

/**
`SLNode` is intended to be implemented and then subclassed.
Expand Down Expand Up @@ -138,15 +139,15 @@
@param nid A valid `SLNid` for a node that will be retrieved from the database.
@param callback A callback for when the asycronous request has returned with the node.
*/
+ (void) readById:(SLNid)nid withCallback:(void (^)(SLModel *))callback;
+ (PMKPromise *) readById:(SLNid)nid;

/**
Returns the node with id corresponding to `SLNid`.
@param nid A valid `SLNid` for a node that will be retrieved from the database.
@param filters `NSDictionary` representing the desired fields and relationships to be requested.
@param callback A callback for when the asycronous request has returned with the node.
*/
+ (void) readById:(SLNid)nid withFilters:(NSDictionary *)filters withCallback:(void (^)(SLModel *))callback;
+ (PMKPromise *) readById:(SLNid)nid withFilters:(NSDictionary *)filters;


/**
Expand All @@ -161,7 +162,7 @@
@deprecate Use `readAllWithAPIManager` instead.
*/
+ (void) readAllWithCallback:(void (^)(NSArray *))callback DEPRECATED_ATTRIBUTE;
+ (PMKPromise *) readAll;

/**
Returns all nodes of the type subclassed by `SLNode`.
Expand All @@ -172,7 +173,7 @@
@deprecate Use `readAllWithAPIManager` instead.
*/
+ (void) readAllWithFilters:(NSDictionary *)filters withCallback:(void (^)(NSArray *))callback DEPRECATED_ATTRIBUTE;
+ (PMKPromise *) readAllWithFilters:(NSDictionary *)filters;

/**
Returns all nodes of the type subclassed by `SLNode`.
Expand All @@ -182,7 +183,7 @@
@param filters `NSDictionary` representing the desired fields and relationships to be requested.
@return void
*/
+ (void) readAllWithAPIManager:(SLAPIManager *)manager withFilters:(NSDictionary *)filters withCallback:(void (^)(NSArray *))callback;
+ (PMKPromise *) readAllWithAPIManager:(SLAPIManager *)manager withFilters:(NSDictionary *)filters;


/**
Expand Down
Loading

0 comments on commit 7ae4067

Please sign in to comment.