-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMModelCollection.h
58 lines (41 loc) · 1.47 KB
/
MModelCollection.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
57
58
//
// MModelCollection.h
// Packer
//
// Created by Ben Gotow on 4/17/13.
// Copyright (c) 2013 Mib.io. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "MRestfulObject.h"
#import "MModelCollectionFetcher.h"
#import "MAPIClient.h"
@class MModel;
@interface MModelCollection : NSObject <NSCoding, MRestfulObject, MModelCollectionFetcherDelegate>
{
NSMutableArray * _cacheArray;
NSMutableDictionary * _cacheDictionary;
}
@property (nonatomic, strong) NSString * collectionName;
@property (nonatomic, assign) BOOL collectionIsNested;
@property (nonatomic, assign) Class collectionClass;
@property (nonatomic, strong) NSObject<MRestfulObject> * parent;
@property (nonatomic, strong) MModelCollectionFetcher * fetcher;
@property (nonatomic, strong) NSDate * refreshDate;
@property (nonatomic, strong) RefreshCallbackBlock refreshCallback;
@property (nonatomic, assign) BOOL refreshInProgress;
- (id)initWithCollectionName:(NSString*)name andClass:(Class)c;
- (id)initWithCoder:(NSCoder *)aDecoder;
- (void)encodeWithCoder:(NSCoder *)aCoder;
- (NSString*)resourcePath;
- (MModel*)objectAtIndex:(NSUInteger)index;
- (MModel*)objectWithID:(NSString*)ID;
- (NSArray*)all;
- (NSArray*)allCached;
- (NSUInteger)count;
- (void)refresh;
- (void)refreshIfOld;
- (void)refreshWithCallback:(RefreshCallbackBlock)callback;
- (void)rebuildDictionaryCache;
- (void)modelsFetched:(NSArray*)jsons replaceExistingContents:(BOOL)replaceExistingContents;
- (void)modelsFetchFailed;
@end