//
//  ICRPatrolPlan.m
//  XFFruit
//
//  Created by Lili Wang on 15/5/29.
//  Copyright (c) 2015年 Xummer. All rights reserved.
//

#import "ICRPatrolPlan.h"
#import "ICRQuestion.h"

@implementation ICRPatrolPlan

+ (NSDictionary *)specialKeysAndReplaceKeys {
    return @{ @"pID" : [[self class] PrimaryKey], };
}

+ (NSString *)PrimaryKey {
    return @"uuid";
}

#pragma mark - Setter
- (void)setQuestions:(NSArray *)questions {
    if ([_questions isEqualToArray:questions]) {
        return;
    }
    _questions = questions;
    
    for (NSDictionary *dict in questions) {
        ICRQuestion *qestion = [ICRQuestion DBObject];
        [qestion praseFromJsonDict:dict];
        
        [self.arrSubModels addObject:qestion];
    }
}

@end
