unbindModel call in CakePhp. How does it work?

前端 未结 3 1565
星月不相逢
星月不相逢 2021-01-12 05:55

How does unbindModel happen in cake?

$this->User->unbindModel(array(\'hasAndBelongsToMany\' => array(\'Friend\')));

I wrote this i

3条回答
  •  耶瑟儿~
    2021-01-12 06:41

    Well, in my experience with unbinds, I can say Paginate always do 2 querys one for count the total and the second for the result array

    unbind destroy just once time the relation and yea you need extend this rule to destroy two or more times so you need to set TRUE I guess to persist this rule:

    $this->User->unbindModel(array('hasAndBelongsToMany' => array('Friend')), true);
    

提交回复
热议问题