/** * Add a new drive component * * @param type $data * @param type $computers_id * @param type $no_history * * @return nothing */ function addDrive($data, $computers_id, $no_history) { $item_DeviceDrive = new Item_DeviceDrive(); $deviceDrive = new DeviceDrive(); $drives_id = $deviceDrive->import($data); $data['devicedrives_id'] = $drives_id; $data['itemtype'] = 'Computer'; $data['items_id'] = $computers_id; $data['is_dynamic'] = 1; $data['_no_history'] = $no_history; $item_DeviceDrive->add($data, array(), !$no_history); }