<$comment
EO Template for use by "eogenerator" based upon MiscMerge engine.
You may customize this file to modify the templates generated
by this tool.  See the MiscMerge documentation for a description
of the parsing language.  The engine gets passed this file and an
EOEntity to process, so the methods used must be ones that an
EOEntity can respond to.

BE SURE NOT TO INCLUDE DATES IN THIS FILE.  Since the "eogenerator"
tool tries to compare the newly generated file with the old file,
adding dates to this file will guarantee the old file gets
overridden by the new file, forcing a recompilation of your EO.$>

// <$GEN_PREFIX$><$className$>.m
// 
// Created by eogenerator
// DO NOT EDIT.  Make changes to <$className$>.m instead.

#import "<$GEN_PREFIX$><$className$>.h"
<$foreach relationship referencedClasses.@reversedArray do
$>#import "<$relationship$>.h"
<$endforeach do$><$if FetchSpecs.@count gt 0$>
#import <EOAccess/EOUtilities.h><$endif$>
@implementation <$GEN_PREFIX$><$className$>

// EOF invokes this init method when creating objects.
- (id)initWithEditingContext:(EOEditingContext *)editingContext classDescription:(EOClassDescription *)classDesc globalID:(EOGlobalID *)gid
{
    self = [super initWithEditingContext:editingContext classDescription:classDesc globalID:gid];
    return self;
}

// This init method is usually used from user code.
- (id)init
{
    self = [super init];
    return self;
}
<$foreach attribute classAttributes.@sortedNameArray do$>
- (void)set<$attribute.name.initialCapitalString$>:(<$attribute.valueClassName$> *)aValue
{
    [self takeStoredValue:aValue forKey:@"<$attribute.name$>"];
}

- (<$attribute.valueClassName$> *)<$attribute.name$>
{
    return [self storedValueForKey:@"<$attribute.name$>"];
}
<$endforeach do
$><$foreach toOneRelationship classToOneRelationships.@sortedNameArray do$>
- (void)set<$toOneRelationship.name.initialCapitalString$>:(<$toOneRelationship.destinationEntity.referenceClassName$>)aValue
{
    [self takeStoredValue:aValue forKey:@"<$toOneRelationship.name$>"];
}

- (<$toOneRelationship.destinationEntity.referenceClassName$>)<$toOneRelationship.name$>
{
    return [self storedValueForKey:@"<$toOneRelationship.name$>"];
}
<$endforeach do
$><$foreach toManyRelationship classToManyRelationships.@sortedNameArray do$>
- (void)set<$toManyRelationship.name.initialCapitalString$>:(NSMutableArray *)aValue
{
    [self takeStoredValue:aValue forKey:@"<$toManyRelationship.name$>"];
}

- (NSArray *)<$toManyRelationship.name$>
{
    return [self storedValueForKey:@"<$toManyRelationship.name$>"];
}

- (void)addTo<$toManyRelationship.name.initialCapitalString$>:(<$toManyRelationship.destinationEntity.referenceClassName$>)object
{
    NSMutableArray *array = (NSMutableArray *)[self <$toManyRelationship.name$>];

    [self willChange];
    [array addObject:object];
}

- (void)removeFrom<$toManyRelationship.name.initialCapitalString$>:(<$toManyRelationship.destinationEntity.referenceClassName$>)object
{
    NSMutableArray *array = (NSMutableArray *)[self <$toManyRelationship.name$>];

    [self willChange];
    [array removeObject:object];
}
<$endforeach do$>
@end