I was wondering what's the best way to implement a "counter" sort of behavior
(doesn't need to actually be a doctrine behavior, just the concept)..

I have 2 models... Topics and Posts
In topics there is a column Topics.post_count that I want to keep
(obviously) the number of posts the topic has.

Whats the best way to do this?

Option A.
Post::postInsert() ... Increment Topics.postCount ++;
Post::postDelete() ... Decrement Topics.post_count --;

Option B.
Post::postSave() ... Call Topic->updatePostCount() which does a simple
SELECT COUNT(*) on posts




-- 
View this message in context: 
http://n4.nabble.com/Doctrine-Counter-Behavior-tp1010418p1010418.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to