Thanks for repoing and improving this excellent Behaviour. It would be great if it was a bit smarter. Most of the aggregates can be computed beforeSave and beforeDelete just by knowing about the item that has changed and the old aggregate value that has already been calculated previously - saving a potentially heavy database query. Obviously you cannot always compute the new aggregate but in a majority of times it would.
Once this is done, future features could be that it could rely on the actual Cache to store aggregate values rather than in the database. Wow.
Thanks for repoing and improving this excellent Behaviour. It would be great if it was a bit smarter. Most of the aggregates can be computed beforeSave and beforeDelete just by knowing about the item that has changed and the old aggregate value that has already been calculated previously - saving a potentially heavy database query. Obviously you cannot always compute the new aggregate but in a majority of times it would.
Once this is done, future features could be that it could rely on the actual Cache to store aggregate values rather than in the database. Wow.