/** * get current object id for import id (static) * * import ids can exist multiple times (if the same learning module * has been imported multiple times). we get the object id of * the last imported object, that is not in trash * * @param int $a_import_id import id * * @return int id */ function _getIdForImportId($a_import_id) { global $ilDB; $q = "SELECT obj_id FROM lm_data WHERE import_id = " . $ilDB->quote($a_import_id, "text") . " " . " ORDER BY create_date DESC"; $obj_set = $ilDB->query($q); while ($obj_rec = $ilDB->fetchAssoc($obj_set)) { $lm_id = ilLMObject::_lookupContObjID($obj_rec["obj_id"]); // link only in learning module, that is not trashed include_once "./Services/Help/classes/class.ilObjHelpSettings.php"; if (ilObject::_hasUntrashedReference($lm_id) || ilObjHelpSettings::isHelpLM($lm_id)) { return $obj_rec["obj_id"]; } } return 0; }