Override which entity

Posts   
 
    
ianvink
User
Posts: 394
Joined: 15-Dec-2006
# Posted on: 11-Jan-2007 08:07:42   

I have an object tree

Continent.County.City

When a user makes a change to some cities of a country and those change are saved to the DB, I need to then do some business logic to _that _country.

Which event/method should I override?

Ian

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 11-Jan-2007 10:24:24   

You could try a validator and the validate before save routine of the validator (which you should override, see the field / entity validation section in the manual). This validation logic is then called when the entity is saved (before it's saved actually). Set the Country classes validator to an instance of that validator. (this can be automated, see the validation section in the manual) If a country isn't changed, it's not saved so the validation logic is only called when the country is changed and has to be saved. simple_smile

Frans Bouma | Lead developer LLBLGen Pro