Permalink
Browse files

Alter the names of the multiple object fetches for consistency.

  • Loading branch information...
1 parent 6367b25 commit eec916402aca39c72d96c12f59ef64c7d5da2e64 @danielctull committed Feb 4, 2011
Showing with 32 additions and 29 deletions.
  1. +8 −8 NSManagedObjectContext+DCTDataFetching.h
  2. +24 −21 NSManagedObjectContext+DCTDataFetching.m
@@ -44,17 +44,17 @@
/* If the fetch fails, the error will be logged
*/
-- (NSArray *)dct_fetchAllObjectsForEntityName:(NSString *)entityName;
+- (NSArray *)dct_fetchObjectsForEntityName:(NSString *)entityName;
-- (NSArray *)dct_fetchAllObjectsForEntityName:(NSString *)entityName
- predicate:(NSPredicate *)predicate;
+- (NSArray *)dct_fetchObjectsForEntityName:(NSString *)entityName
+ predicate:(NSPredicate *)predicate;
-- (NSArray *)dct_fetchAllObjectsForEntityName:(NSString *)entityName
- predicate:(NSPredicate *)predicate
- sortDescriptors:(NSArray *)sortDescriptors;
+- (NSArray *)dct_fetchObjectsForEntityName:(NSString *)entityName
+ predicate:(NSPredicate *)predicate
+ sortDescriptors:(NSArray *)sortDescriptors;
-- (NSArray *)dct_fetchAllObjectsForEntityName:(NSString *)entityName
- sortDescriptors:(NSArray *)sortDescriptors;
+- (NSArray *)dct_fetchObjectsForEntityName:(NSString *)entityName
+ sortDescriptors:(NSArray *)sortDescriptors;
- (NSArray *)dct_fetchObjectsForEntityName:(NSString *)entityName
predicate:(NSPredicate *)predicate
@@ -42,35 +42,35 @@ @implementation NSManagedObjectContext (DCTDataFetching)
#pragma mark -
#pragma mark Fetching Multiple Objects
-- (NSArray *)dct_fetchAllObjectsForEntityName:(NSString *)entityName {
+- (NSArray *)dct_fetchObjectsForEntityName:(NSString *)entityName {
return [self dct_fetchObjectsForEntityName:entityName
- predicate:nil
- sortDescriptors:nil
- batchSize:DCTFetchBatchSizeNil];
+ predicate:nil
+ sortDescriptors:nil
+ batchSize:DCTFetchBatchSizeNil];
}
-- (NSArray *)dct_fetchAllObjectsForEntityName:(NSString *)entityName
- predicate:(NSPredicate *)predicate {
+- (NSArray *)dct_fetchObjectsForEntityName:(NSString *)entityName
+ predicate:(NSPredicate *)predicate {
return [self dct_fetchObjectsForEntityName:entityName
predicate:predicate
sortDescriptors:nil
batchSize:DCTFetchBatchSizeNil];
}
-- (NSArray *)dct_fetchAllObjectsForEntityName:(NSString *)entityName
- predicate:(NSPredicate *)predicate
- sortDescriptors:(NSArray *)sortDescriptors {
+- (NSArray *)dct_fetchObjectsForEntityName:(NSString *)entityName
+ predicate:(NSPredicate *)predicate
+ sortDescriptors:(NSArray *)sortDescriptors {
return [self dct_fetchObjectsForEntityName:entityName
predicate:predicate
sortDescriptors:sortDescriptors
batchSize:DCTFetchBatchSizeNil];
}
-- (NSArray *)dct_fetchAllObjectsForEntityName:(NSString *)entityName
- sortDescriptors:(NSArray *)sortDescriptors {
+- (NSArray *)dct_fetchObjectsForEntityName:(NSString *)entityName
+ sortDescriptors:(NSArray *)sortDescriptors {
return [self dct_fetchObjectsForEntityName:entityName
predicate:nil
@@ -80,13 +80,16 @@ - (NSArray *)dct_fetchAllObjectsForEntityName:(NSString *)entityName
// The one method that does the heavy lifting:
- (NSArray *)dct_fetchObjectsForEntityName:(NSString *)entityName
- predicate:(NSPredicate *)predicate
- sortDescriptors:(NSArray *)sortDescriptors
- batchSize:(NSUInteger)batchSize {
+ predicate:(NSPredicate *)predicate
+ sortDescriptors:(NSArray *)sortDescriptors
+ batchSize:(NSUInteger)batchSize {
NSEntityDescription *entity = [NSEntityDescription entityForName:entityName inManagedObjectContext:self];
- NSFetchRequest *request = [[NSFetchRequest alloc] dct_initWithEntity:entity predicate:predicate sortDescriptors:sortDescriptors batchSize:batchSize];
+ NSFetchRequest *request = [[NSFetchRequest alloc] dct_initWithEntity:entity
+ predicate:predicate
+ sortDescriptors:sortDescriptors
+ batchSize:batchSize];
NSError *error = nil;
@@ -107,24 +110,24 @@ - (NSArray *)dct_fetchObjectsForEntityName:(NSString *)entityName
- (id)dct_fetchAnyObjectForEntityName:(NSString *)entityName {
return [self dct_fetchFirstObjectForEntityName:entityName
- predicate:nil
- sortDescriptors:nil];
+ predicate:nil
+ sortDescriptors:nil];
}
- (id)dct_fetchAnyObjectForEntityName:(NSString *)entityName
predicate:(NSPredicate *)predicate {
return [self dct_fetchFirstObjectForEntityName:entityName
- predicate:predicate
- sortDescriptors:nil];
+ predicate:predicate
+ sortDescriptors:nil];
}
- (id)dct_fetchFirstObjectForEntityName:(NSString *)entityName
sortDescriptors:(NSArray *)sortDescriptors {
return [self dct_fetchFirstObjectForEntityName:entityName
- predicate:nil
- sortDescriptors:sortDescriptors];
+ predicate:nil
+ sortDescriptors:sortDescriptors];
}
- (id)dct_fetchFirstObjectForEntityName:(NSString *)entityName

0 comments on commit eec9164

Please sign in to comment.