//
//  ICRStoreResult.m
//  XFFruit
//
//  Created by Xummer on 15/6/7.
//  Copyright (c) 2015年 Xummer. All rights reserved.
//

#import "ICRStoreResult.h"
#import "ICRAnswer.h"

@implementation ICRStoreResult

+ (NSArray *)localKeys {
    return @[ @"planID", @"isNotUploaded" ];
}

+ (NSArray *)PrimaryKeys {
    return @[ @"planID", @"storeId" ];
}

#pragma mark - Setter
- (void)setAnswers:(NSArray *)answers {
    if ([_answers isEqualToArray:answers]) {
        return;
    }
    
    _answers = answers;
    
    for (NSDictionary *dict in answers) {
        ICRAnswer *answer = [ICRAnswer DBObject];
        [answer praseFromJsonDict:dict];
        
        [self.arrSubModels addObject:answer];
    }
}

@end
