function delete(&$category) { global $xoopsModule; $forum_handler = &xoops_getmodulehandler('forum', 'xforum'); $forum_handler->deleteAll(new Criteria("cat_id", $category->getVar('cat_id')), true, true); if ($result = parent::delete($category)) { // Delete group permissions return $this->deletePermission($category); } else { $category->setErrors("delete category error: ".$sql); return false; } }
/** * delete an object as well as links relying on it * * @param object $object {@link NewbbType} * @param bool $force flag to force the query execution despite security settings * @return bool */ function delete(&$object, $force = true) { if (!is_object($object) || !$object->getVar($this->keyName)) { return false; } $queryFunc = empty($force) ? "query" : "queryF"; /* * Remove forum-type links */ $sql = "DELETE" . " FROM " . $this->db->prefix("bb_type_forum") . " WHERE " . $this->keyName . " = " . $object->getVar($this->keyName); if (($result = $this->db->{$queryFunc}($sql)) == false) { // xoops_error($this->db->error()); } /* * Reset topic type linked to this type */ $sql = "UPATE" . " " . $this->db->prefix("bb_topics") . " SET " . $this->keyName . "=0" . " WHERE " . $this->keyName . " = " . $object->getVar($this->keyName); if (($result = $this->db->{$queryFunc}($sql)) == false) { //xoops_error($this->db->error()); } return parent::delete($object, $force); }
function delete(&$xforum) { global $xoopsModule; // RMV-NOTIFY xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'forum', $xforum->getVar('forum_id')); // Get list of all topics in forum, to delete them too $topic_handler =& xoops_getmodulehandler('topic', 'xforum'); $topic_handler->deleteAll(new Criteria("forum_id", $xforum->getVar('forum_id')), true, true); $this->updateAll("parent_forum", $xforum->getVar('parent_forum'), new Criteria("parent_forum", $xforum->getVar('forum_id'))); $this->deletePermission($xforum); return parent::delete($xforum); }
/** * delete an object as well as links relying on it * * @param object $object {@link NewbbTag} * @param bool $force flag to force the query execution despite security settings * @return bool */ function delete(&$object, $force = true) { if (!is_object($object) || !$object->getVar($this->keyName)) { return false; } $queryFunc = empty($force) ? "query" : "queryF"; /* * Remove item-tag links */ $sql = "DELETE" . " FROM {$this->table_link}" . " WHERE {$this->keyName} = " . $object->getVar($this->keyName); if (($result = $this->db->{$queryFunc}($sql)) == false) { // xoops_error($this->db->error()); } /* * Remove stats-tag links */ $sql = "DELETE" . " FROM {$this->table_stats}" . " WHERE {$this->keyName} = " . $object->getVar($this->keyName); if (($result = $this->db->{$queryFunc}($sql)) == false) { // xoops_error($this->db->error()); } return parent::delete($object, $force); }