tp3.2.3 MANY_TO_MANY 关联删除问题

浏览:905 发布日期:2015/05/12 分类:求助交流 关键字: 关联删除
建立多对多关联:
protected $_link = array(
'attribute' => array(
'mapping_type' => self:: MANY_TO_MANY,
'mapping_name' => 'attribute',
'foreign_key' => 'blogid',
'relation_foreign_key' => 'attrid',
'relation_table' => 'think_blog_attribute',
'mapping_order'=> 'id'
),

模型中:
public function delete($id){
$res= $this-> relation("attribute")-> delete($id);
return $res;
}

其中$id是通过get方法传递的id值

控制器中:
public function delete() {
$id= I('id', '', 'int');
$res= D('Blog')-> delete($id);
p($res);
}

结果报错:
Fatal error: Maximum function nesting level of '100' reached, aborting! in E:\wamp\www\daniuer\ThinkPHP\Library\Think\Model\RelationModel.class.php on line 396

请大侠帮忙看看是怎么回事
最佳答案
评论( 相关
后面还有条评论,点击查看>>