public function delete() { global $DB; // remove all old entries if (!empty($this->id)) { $DB->execute(' DELETE FROM nv_comments WHERE id = ' . intval($this->id) . ' LIMIT 1 '); // remove all properties of the comment property::remove_properties('comment', $this->id); } return $DB->get_affected_rows(); }
public function delete() { global $DB; global $user; if ($user->permission("items.delete") == 'false') { throw new Exception(t(610, "Sorry, you are not allowed to execute this function.")); } if (!empty($this->id) && !empty($this->website)) { // remove dictionary elements webdictionary::save_element_strings('item', $this->id, array(), $this->website); // remove path elements path::saveElementPaths('item', $this->id, array(), $this->website); // remove all votes assigned to element webuser_vote::remove_object_votes('item', $this->id); // remove all element properties property::remove_properties('item', $this->id); // finally remove the item $DB->execute(' DELETE FROM nv_items WHERE id = ' . intval($this->id) . ' AND website = ' . $this->website); } return $DB->get_affected_rows(); }
public function delete() { global $DB; global $events; if (!empty($this->id)) { // remove all social profiles $DB->execute(' DELETE FROM nv_webuser_profiles WHERE webuser = '******'webuser', $this->id); // finally remove webuser account $DB->execute(' DELETE FROM nv_webusers WHERE id = ' . intval($this->id) . ' LIMIT 1 '); $events->trigger('webuser', 'delete', array('webuser' => $this)); } return $DB->get_affected_rows(); }
public function delete() { global $DB; if (!empty($this->id)) { // remove dictionary entries webdictionary::save_element_strings('structure', $this->id, array()); // remove paths path::saveElementPaths('structure', $this->id, array(), $this->website); // remove all votes assigned webuser_vote::remove_object_votes('structure', $this->id); // remove the properties property::remove_properties('structure', $this->id); // remove the structure entry $DB->execute(' DELETE FROM nv_structure WHERE id = ' . intval($this->id) . ' AND website = ' . $this->website . ' LIMIT 1'); } return $DB->get_affected_rows(); }