I have a BelongsToMany
association, my tables are PostsTable
, TagsTable
and PostsTagsTable
.
As explained here in the CakePHP book (associations), I have this fields:
tags.id, tags.tag, tags.post_count
posts_tags.id, posts_tags.tag_id, posts_tags.post_id
Everything works correctly for now.
So, as you can understand, now I want to use the tags.post_count
field with CounterCache
.
I followed the CakePHP book, but I suppose this is a special case, in fact it doesn't work by simply adding the behavior to the PostsTable
.
Can you help me? Thanks.