Transfer::cleanSoftwares PHP Method

cleanSoftwares() public method

public cleanSoftwares ( )
    function cleanSoftwares()
    {
        if (!isset($this->already_transfer['Software'])) {
            return;
        }
        $soft = new Software();
        foreach ($this->already_transfer['Software'] as $old => $new) {
            if (countElementsInTable("glpi_softwarelicenses", ['softwares_id' => $old]) == 0 && countElementsInTable("glpi_softwareversions", ['softwares_id' => $old]) == 0) {
                if ($this->options['clean_software'] == 1) {
                    // delete
                    $soft->delete(array('id' => $old), 0);
                } else {
                    if ($this->options['clean_software'] == 2) {
                        // purge
                        $soft->delete(array('id' => $old), 1);
                    }
                }
            }
        }
    }