09/01/31 21:53:45
>>557
ゆとりなの?死ぬの?
こんな風に A のモデル書いて
class A extends AppModel
{
var $hasMany = array('B' => array(
'className' => 'B',
'conditions' => array('B.delete' = 'not delete'),
),);
function hogehoge()
{
unset($this->hasMany['B']['conditions']['B.delete']);
return $this->find('all');
}
}
で、普段はコントローラから $this->A->find() でデータ取得して、
B.delete を無視する時は $this->A->hogehoge() 使うようにするだろう。jk