//
//  GTOPatrolTemplate.m
//  total
//
//  Created by freecui on 15/10/13.
//  Copyright (c) 2015年 free. All rights reserved.
//

#import "GTOPatrolTemplate.h"
#import "GTOQuestion.h"

@implementation GTOPatrolTemplate

+ (NSDictionary *)specialKeysAndReplaceKeys {
    return @{@"templateId":[[self class] PrimaryKey]};
}
+ (NSString *)PrimaryKey {
    return @"uuid";
}
- (void)setQuestions:(NSArray *)questions{
    if ([_questions isEqualToArray:questions]) {
        return;
    }
    _questions = questions;
    
    for(NSDictionary *dict in questions) {
        GTOQuestion *question = [GTOQuestion DBObject];
        [question praseFromJsonDict:dict];
        
        [self.arrSubModels addObject:question];
    }
}
@end


