Group::cleanDBonPurge PHP Method

cleanDBonPurge() public method

public cleanDBonPurge ( )
    function cleanDBonPurge()
    {
        global $DB;
        $gu = new Group_User();
        $gu->cleanDBonItemDelete($this->getType(), $this->fields['id']);
        $gt = new Group_Ticket();
        $gt->cleanDBonItemDelete($this->getType(), $this->fields['id']);
        $gp = new Group_Problem();
        $gp->cleanDBonItemDelete($this->getType(), $this->fields['id']);
        $cg = new Change_Group();
        $cg->cleanDBonItemDelete($this->getType(), $this->fields['id']);
        $query1 = "DELETE\n                 FROM `glpi_projecttaskteams`\n                 WHERE `items_id` = '" . $this->fields['id'] . "'\n                       AND `itemtype` = '" . __CLASS__ . "'";
        $DB->query($query1);
        $query1 = "DELETE\n                 FROM `glpi_projectteams`\n                 WHERE `items_id` = '" . $this->fields['id'] . "'\n                       AND `itemtype` = '" . __CLASS__ . "'";
        $DB->query($query1);
        $gki = new Group_KnowbaseItem();
        $gki->cleanDBonItemDelete($this->getType(), $this->fields['id']);
        $gr = new Group_Reminder();
        $gr->cleanDBonItemDelete($this->getType(), $this->fields['id']);
        // Ticket rules use various _groups_id_*
        Rule::cleanForItemAction($this, '_groups_id%');
        Rule::cleanForItemCriteria($this, '_groups_id%');
        // GROUPS for RuleMailcollector
        Rule::cleanForItemCriteria($this, 'GROUPS');
        // Set no group to consumables
        $query = "UPDATE `glpi_consumables`\n                SET `items_id` = '0'\n                WHERE `items_id` = '" . $this->fields['id'] . "'\n                      AND `itemtype` = 'Group'";
        $DB->query($query);
    }