Convert RKConnectionMapping into a subclass of RKPropertyMapping. Add delegate callback for tracking the connection of relationships.

This commit is contained in:
Blake Watters
2012-09-29 17:49:13 -04:00
parent 0539aeb45e
commit 4c401de6bf
6 changed files with 82 additions and 68 deletions

View File

@@ -21,12 +21,11 @@
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import "RKMapping.h"
#import "RKPropertyMapping.h"
@class RKConnectionMapping, RKDynamicMappingMatcher;
@protocol RKManagedObjectCaching;
typedef id (^RKObjectConnectionBlock)(RKConnectionMapping *mapping, id source);
// Defines the rules for connecting relationsips
/**
Instructs RestKit to connect a relationship of the object being mapped to the
@@ -93,11 +92,10 @@ typedef id (^RKObjectConnectionBlock)(RKConnectionMapping *mapping, id source);
@see connectRelationship:withObjectForPrimaryKeyAttribute:
*/
@interface RKConnectionMapping : NSObject
@interface RKConnectionMapping : RKPropertyMapping
@property (nonatomic, strong, readonly) NSRelationshipDescription *relationship;
@property (nonatomic, strong, readonly) NSString *sourceKeyPath;
@property (nonatomic, strong, readonly) NSString *destinationKeyPath;
@property (nonatomic, strong, readonly) RKDynamicMappingMatcher *matcher; // Can be nil
// Returns YES if the receiver describes a connection between entities that is established