Minahito
minah****@users*****
2006年 1月 14日 (土) 03:17:39 JST
Index: xoops2jp/html/modules/base/kernel/handler.php diff -u xoops2jp/html/modules/base/kernel/handler.php:1.1.2.7 xoops2jp/html/modules/base/kernel/handler.php:1.1.2.8 --- xoops2jp/html/modules/base/kernel/handler.php:1.1.2.7 Sat Jan 14 02:54:57 2006 +++ xoops2jp/html/modules/base/kernel/handler.php Sat Jan 14 03:17:39 2006 @@ -235,9 +235,10 @@ */ function delete(&$obj, $force=false) { - $criteria = new Criteria($this->mPrimary, $obj->get($this->mPrimary)); + $id = $this->db->quoteString($obj->get($this->mPrimary)); + $sql = "DELETE FROM " . $this->mTable . " WHERE " . $this->mPrimary . "=${id}"; - return $this->deleteAll($criteria, $force); + return $force ? $this->db->queryF($sql) : $this->db->query($sql); } /** @@ -245,11 +246,15 @@ */ function deleteAll($criteria, $force=false) { - $objs =& $this->getObjects($criteria, $force); + $objs =& $this->getObjects($criteria); + + $flag = true; foreach ($objs as $obj) { - $this->delete($obj, $force); + $flag &= $this->delete($obj, $force); } + + return $flag; } }