/** * Delete all ports connected in hub and not found in last inventory * * @param $hub_id integer id of the hub (unmanaged device) * @param $a_portUsed array list of the ports found in last inventory * * @return nothing * **/ function deleteNonUsedPortHub($hub_id, $a_portUsed) { $Netport = new NetworkPort(); $a_ports = $Netport->find("`items_id`='" . $hub_id . "'\n AND `itemtype`='" . $this->getType() . "'\n AND (`name` != 'Link' OR `name` IS NULL)"); foreach ($a_ports as $data) { if (!isset($a_portUsed[$data['id']])) { //plugin_fusioninventory_addLogConnection("remove", $port_id); $this->disconnectDB($data['id']); $Netport->deleteFromDB($data['id']); } } }