1
嗨,我在2.0中使用Countercache我需要添加一些條件如下。 但它不起作用。如果'counterCache'=> true它增加字段,它不考慮我添加的條件。Cakephp Countercache問題
後的hasMany WallPost
WallPost屬於發佈
public $belongsTo = array(
'WallPost' => array(
'className' => 'WallPost',
'foreignKey' => 'wallpost_id',
'counterScope' =>array(
'WallPost.post_id' =>3,
),
'fields' => '',
'order' => '',
'counterCache' => true
),
我已經檢查了cakephp文檔在1.3中,我發現了有關計數器緩存的問題,並且它的正確性依據1.3,但在2.0中,我無法找到任何與計數器緩存相關的主題。 – Vins 2012-07-13 11:55:07
看起來很好根據2.0的書以及:http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html – Dave 2012-07-13 13:18:12
是的我經歷了食譜,但無法找到任何解決方案:( – AnNaMaLaI 2012-07-13 13:34:54