Hi i am using Countercache in 2.0 i need to add some condition as follows.
But it is not working.. Its incrementing the field if ‘counterCache’ => true, It not consider the condition i added.
Post hasMany WallPost
WallPost belongs to Post
public $belongsTo = array(
'WallPost' => array(
'className' => 'WallPost',
'foreignKey' => 'wallpost_id',
'counterScope' =>array(
'WallPost.post_id' =>3,
),
'fields' => '',
'order' => '',
'counterCache' => true
),
What you want is:
You are right though the documentation is confusing on this.