Skip to content

Commit

Permalink
Expose allAttributes and allRelationships, related to #328
Browse files Browse the repository at this point in the history
  • Loading branch information
protocool committed Jan 11, 2017
1 parent 9e403ad commit f5fbfe9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mogenerator.m
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ - (NSString*)forcedCustomBaseClass {
return userInfoCustomBaseClass ? userInfoCustomBaseClass : gCustomBaseClassForced;
}
/** @TypeInfo NSAttributeDescription */
- (NSArray*)allAttributes {
NSArray *sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES]];
return [[[self attributesByName] allValues] sortedArrayUsingDescriptors:sortDescriptors];
}
/** @TypeInfo NSAttributeDescription */
- (NSArray*)noninheritedAttributes {
NSArray *sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES]];
NSEntityDescription *superentity = [self superentity];
Expand Down Expand Up @@ -233,7 +238,12 @@ - (NSArray*)noninheritedAttributesSansType {
}
return filteredAttributeDescriptions;
}
/** @TypeInfo NSAttributeDescription */
/** @TypeInfo NSRelationshipDescription */
- (NSArray*)allRelationships {
NSArray *sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES]];
return [[[self relationshipsByName] allValues] sortedArrayUsingDescriptors:sortDescriptors];
}
/** @TypeInfo NSRelationshipDescription */
- (NSArray*)noninheritedRelationships {
NSArray *sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES]];
NSEntityDescription *superentity = [self superentity];
Expand Down

0 comments on commit f5fbfe9

Please sign in to comment.