-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMModel.h
56 lines (41 loc) · 1.24 KB
/
MModel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// MDictionaryBackedObject.h
// Mib.io
//
// Created by Ben Gotow on 6/7/12.
// Copyright (c) 2012 Foundry376. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "MRestfulObject.h"
#import "MAPITransaction.h"
typedef enum SaveState {
Unsaved = 0,
UnsavedChanges = 1,
Synced = 2,
Partial = 3
} SaveState;
@interface MModel : NSObject <NSCoding, MRestfulObject>
{
}
@property (nonatomic, strong) NSString * ID;
@property (nonatomic, strong) NSString * resourcePathOverride;
@property (nonatomic, strong) NSDate * createdAt;
@property (nonatomic, strong) NSDate * updatedAt;
@property (atomic, assign) SaveState state;
@property (atomic, weak) NSObject<MRestfulObject> * parent;
+ (NSMutableDictionary *)resourceKeysForPropertyKeys;
- (id)initWithDictionary:(NSDictionary*)json;
- (id)initWithCoder:(NSCoder *)aDecoder;
- (void)encodeWithCoder:(NSCoder *)aCoder;
- (void)setup;
- (NSComparisonResult)sort:(MModel*)other;
- (NSString*)ID;
- (BOOL)isEqual:(id)object;
- (BOOL)isSaved;
- (BOOL)isUnsaved;
- (NSString*)description;
- (NSMutableDictionary*)resourceJSON;
- (void)updateWithResourceJSON:(NSDictionary*)json;
- (void)save:(MAPITransactionCallback)callback;
- (void)reload:(MAPITransactionCallback)callback;
@end