Well ok then:
User hasMany Post
User hasMany Comment
Within the users table you would have a column called post_count and
comment_count.
Within the Post and Comment model you would have.
var $belongsTo = array('User' => array('counterCache' => true));
And thats it.
On Aug 29, 3:45 pm, Aivaras <[email protected]> wrote:
> Sorry to say Miles, but the guy was asking for a double counterCache :x
>
> So, if User hasMany Post
> and User hasMany Recipe
>
> the guy would want user_post_count and user_recipe count in his users table.
>
> Unfortunately, I do not know the solution with cake's countercache :(
>
> Faifas
>
> On Sun, Aug 30, 2009 at 01:39, Miles J <[email protected]> wrote:
>
> > All you do is set it to true in your model associations, and whenever
> > an insert/delete happens the number changes. The manual describes it
> > pretty easily.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---