From f7a63cbd9f8ca808a751b9a121be9d401260df37 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 5 May 2016 13:13:21 +0800 Subject: [PATCH] =?UTF-8?q?relation=E7=B1=BBdelete=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=88=A0=E9=99=A4=20=EF=BC=88=E5=9B=A0=E4=B8=BA=E5=BD=B1?= =?UTF-8?q?=E5=93=8D=E6=A8=A1=E5=9E=8B=E5=88=A0=E9=99=A4=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/model/Relation.php | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/library/think/model/Relation.php b/library/think/model/Relation.php index b5fde757..fd29647b 100644 --- a/library/think/model/Relation.php +++ b/library/think/model/Relation.php @@ -444,29 +444,6 @@ class Relation ->where($condition); } - /** - * 删除当前关联数据对象 - * @access public - * @param mixed $where 删除条件 一对多删除可以指定条件 多对多可以使用关联对象的主键删除 - * @return integer - */ - public function delete($where = []) - { - // 判断关联类型 - switch ($this->type) { - case self::HAS_ONE: - case self::BELONGS_TO: - case self::HAS_MANY: - // 保存关联表数据 - $where[$this->foreignKey] = $this->parent->{$this->localKey}; - $model = $this->model; - return $model::where($where)->delete(); - case self::BELONGS_TO_MANY: - // 删除关联表/中间表数据 - return $this->detach($where); - } - } - /** * 保存(新增)当前关联数据对象 * @access public