Computer::getLinkedItems PHP Method

getLinkedItems() public method

Return the linked items (in computers_items)
public getLinkedItems ( ) : an
return an array of linked items like array('Computer' => array(1,2), 'Printer' => array(5,6))
    function getLinkedItems()
    {
        global $DB;
        $query = "SELECT `itemtype`, `items_id`\n                FROM `glpi_computers_items`\n                WHERE `computers_id` = '" . $this->fields['id'] . "'";
        $tab = array();
        foreach ($DB->request($query) as $data) {
            $tab[$data['itemtype']][$data['items_id']] = $data['items_id'];
        }
        return $tab;
    }