-
Notifications
You must be signed in to change notification settings - Fork 1
/
ActiveRecord.h
executable file
·57 lines (44 loc) · 1.24 KB
/
ActiveRecord.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
//
// ActiveRecord.m
// iActiveRecord
//
// Created by Alex Denisov on 10.01.12.
// Copyright (c) 2012 okolodev.org. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <objc/message.h>
#import "ARRelationshipsHelper.h"
#import "ARValidationsHelper.h"
#import "ARLazyFetcher.h"
#import "NSArray+objectsAccessors.h"
#import "ARErrorHelper.h"
#import "ARError.h"
#import "ARRepresentationProtocol.h"
#import "AREnum.h"
#import "ARValidatorProtocol.h"
#import "ARException.h"
#import "ARIndicesMacroHelper.h"
typedef void (^ARTransactionBlock)();
#define ar_rollback \
[ARException raise];
@interface ActiveRecord : NSObject
@property (nonatomic, retain) NSNumber *id;
@property (nonatomic, retain) NSDate *updatedAt;
@property (nonatomic, retain) NSDate *createdAt;
- (void)markAsNew;
- (BOOL)isValid;
- (NSArray *)errors;
- (void)addError:(ARError *)anError;
+ (id)newRecord;
- (BOOL)save;
- (BOOL)update;
- (void)dropRecord;
+ (NSInteger)count;
+ (NSArray *)allRecords;
+ (ARLazyFetcher *)lazyFetcher;
+ (void)dropAllRecords;
+ (void)registerDatabaseName:(NSString *)aDbName useDirectory:(ARStorageDirectory)aDirectory;
+ (void)clearDatabase;
+ (void)disableMigrations;
+ (void)transaction:(ARTransactionBlock)aTransactionBlock;
@end