mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-01 22:42:51 +08:00
relationships in the object mapping graph. Relationships can be optionally included in an inverse mapping generation for serialization purposes.
34 lines
1.2 KiB
Objective-C
34 lines
1.2 KiB
Objective-C
//
|
|
// RKObjectRelationshipMapping.m
|
|
// RestKit
|
|
//
|
|
// Created by Blake Watters on 5/4/11.
|
|
// Copyright 2011 Two Toasters. All rights reserved.
|
|
//
|
|
|
|
#import "RKObjectRelationshipMapping.h"
|
|
|
|
@implementation RKObjectRelationshipMapping
|
|
|
|
@synthesize objectMapping = _objectMapping;
|
|
@synthesize reversible = _reversible;
|
|
|
|
+ (RKObjectRelationshipMapping*) mappingFromKeyPath:(NSString*)sourceKeyPath toKeyPath:(NSString*)destinationKeyPath objectMapping:(RKObjectMapping*)objectMapping reversible:(BOOL)reversible {
|
|
RKObjectRelationshipMapping* mapping = (RKObjectRelationshipMapping*) [self mappingFromKeyPath:sourceKeyPath toKeyPath:destinationKeyPath];
|
|
mapping.objectMapping = objectMapping;
|
|
mapping.reversible = reversible;
|
|
return mapping;
|
|
}
|
|
|
|
+ (RKObjectRelationshipMapping*) mappingFromKeyPath:(NSString*)sourceKeyPath toKeyPath:(NSString*)destinationKeyPath objectMapping:(RKObjectMapping*)objectMapping {
|
|
RKObjectRelationshipMapping* mapping = [self mappingFromKeyPath:sourceKeyPath toKeyPath:destinationKeyPath objectMapping:objectMapping reversible:YES];
|
|
return mapping;
|
|
}
|
|
|
|
- (void)dealloc {
|
|
[_objectMapping release];
|
|
[super dealloc];
|
|
}
|
|
|
|
@end
|