-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathLOFetchSpecification.j
51 lines (43 loc) · 1.77 KB
/
LOFetchSpecification.j
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
/*
* LOFetchSpecification.j
*
* Created by Martin Carlberg on Feb 27, 2012.
* Copyright 2012, All rights reserved.
*/
@import <Foundation/CPObject.j>
@import <Foundation/CPPredicate.j>
@implementation LOFetchSpecification : CPObject
{
CPString entityName @accessors;
CPString alias @accessors; // This is user info for the object store. It can be used to fetch entityName from a function
CPString method @accessors; // This is user info for the object store. It can be used to add to the url path
CPString operator @accessors; // This is user info for the object store. It can be used to add to the url path
CPPredicate qualifier @accessors;
id userInfo @accessors;
Function requestPreProcessBlock @accessors; // This is a block that is called before the request is sent
}
+ (LOFetchSpecification) fetchSpecificationForEntityNamed:(CPString) anEntityName {
return [[LOFetchSpecification alloc] initWithEntityName:anEntityName];
}
- (id)initWithEntityName:(CPString) anEntityName {
self = [super init];
if (self) {
entityName = anEntityName;
}
return self;
}
+ (LOFetchSpecification) fetchSpecificationForEntityNamed:(CPString) anEntityName qualifier:(CPPredicate) aQualifier {
return [[LOFetchSpecification alloc] initWithEntityName:anEntityName qualifier:aQualifier];
}
- (id)initWithEntityName:(CPString) anEntityName qualifier:(CPPredicate) aQualifier {
self = [super init];
if (self) {
entityName = anEntityName;
qualifier = aQualifier;
}
return self;
}
- (CPString)description {
return [CPString stringWithFormat:@"<%@ entityName: %@ operator: %@ qualifer: %@ userInfo: %@>", [self className], entityName, operator, qualifier, userInfo];
}
@end