function cleanDBonPurge() { global $DB; // Delete all licenses $query2 = "SELECT `id`\n FROM `glpi_softwarelicenses`\n WHERE `softwares_id` = '" . $this->fields['id'] . "'"; if ($result2 = $DB->query($query2)) { if ($DB->numrows($result2)) { $lic = new SoftwareLicense(); while ($data = $DB->fetch_assoc($result2)) { $lic->delete(array("id" => $data["id"])); } } } $version = new SoftwareVersion(); $version->cleanDBonItemDelete(__CLASS__, $this->fields['id']); $ip = new Item_Problem(); $ip->cleanDBonItemDelete(__CLASS__, $this->fields['id']); }