本文整理汇总了PHP中ilObject::_getIdForImportId方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObject::_getIdForImportId方法的具体用法?PHP ilObject::_getIdForImportId怎么用?PHP ilObject::_getIdForImportId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObject
的用法示例。
在下文中一共展示了ilObject::_getIdForImportId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getIdForImportId
/**
* Get current id for an import id
*
* @param string $a_type target type ("PageObject" | "StructureObject" |
* "GlossaryItem" | "MediaObject")
* @param string $a_target import target id (e.g. "il_2_pg_22")
*
* @return string current target id (e.g. "il__pg_244")
*/
function _getIdForImportId($a_type, $a_target)
{
switch ($a_type) {
case "PageObject":
$id = ilLMObject::_getIdForImportId($a_target);
if ($id > 0) {
return "il__pg_" . $id;
}
break;
case "StructureObject":
$id = ilLMObject::_getIdForImportId($a_target);
if ($id > 0) {
return "il__st_" . $id;
}
break;
case "GlossaryItem":
$id = ilGlossaryTerm::_getIdForImportId($a_target);
if ($id > 0) {
return "il__git_" . $id;
}
break;
case "WikiPage":
// no import IDs for wiki pages (yet)
//$id = ilGlossaryTerm::_getIdForImportId($a_target);
$id = 0;
if ($id > 0) {
return "il__wpage_" . $id;
}
break;
case "MediaObject":
$id = ilObjMediaObject::_getIdForImportId($a_target);
if ($id > 0) {
return "il__mob_" . $id;
}
break;
case "RepositoryItem":
$tarr = explode("_", $a_target);
$import_id = $a_target;
// if a ref id part is given, strip this
// since this will not be part of an import id
if ($tarr[4] != "") {
$import_id = $tarr[0] . "_" . $tarr[1] . "_" . $tarr[2] . "_" . $tarr[3];
}
if (ilInternalLink::_extractInstOfTarget($a_target) == IL_INST_ID && IL_INST_ID > 0) {
// does it have a ref id part?
if ($tarr[4] != "") {
return "il__obj_" . $tarr[4];
}
}
$id = ilObject::_getIdForImportId($import_id);
//echo "-$a_target-$id-";
// get ref id for object id
// (see ilPageObject::insertInstIntoIDs for the export procedure)
if ($id > 0) {
$refs = ilObject::_getAllReferences($id);
//var_dump($refs);
foreach ($refs as $ref) {
return "il__obj_" . $ref;
}
}
break;
}
return false;
}
示例2: _getIdForImportId
/**
* get current id for an import id
*
* @param string $a_type target type ("PageObject" | "StructureObject" |
* "GlossaryItem" | "MediaObject")
* @param string $a_target import target id (e.g. "il_2_pg_22")
*
* @return string current target id (e.g. "il__pg_244")
*/
function _getIdForImportId($a_type, $a_target)
{
switch ($a_type) {
case "PageObject":
$id = ilLMObject::_getIdForImportId($a_target);
if ($id > 0) {
return "il__pg_" . $id;
}
break;
case "StructureObject":
$id = ilLMObject::_getIdForImportId($a_target);
if ($id > 0) {
return "il__st_" . $id;
}
break;
case "GlossaryItem":
$id = ilGlossaryTerm::_getIdForImportId($a_target);
if ($id > 0) {
return "il__git_" . $id;
}
break;
case "MediaObject":
$id = ilObjMediaObject::_getIdForImportId($a_target);
if ($id > 0) {
return "il__mob_" . $id;
}
break;
case "RepositoryItem":
$id = ilObject::_getIdForImportId($a_target);
//echo "-$a_target-$id-";
// get ref id for object id
// (see ilPageObject::insertInstIntoIDs for the export procedure)
if ($id > 0) {
$refs = ilObject::_getAllReferences($id);
//var_dump($refs);
foreach ($refs as $ref) {
return "il__obj_" . $ref;
}
}
break;
}
return false;
}
示例3:
final function _getIdForImportId($a_import_id)
{
return parent::_getIdForImportId($a_import_id);
}
示例4: parseObjectExportId
/**
* Parse export id
*
* @param string $a_id
* @param int $a_fallback_id
* @return array type, id
*/
protected function parseObjectExportId($a_id, $a_fallback_id = NULL)
{
// ilias export id?
if (substr($a_id, 0, 3) == "il_") {
$parts = explode("_", $a_id);
$inst_id = $parts[1];
$type = $parts[2];
$id = $parts[3];
// missing installation ids?
if (($inst_id == 0 || IL_INST_ID == 0) && !DEVMODE) {
return array("type" => self::EXPORT_NO_INST_ID, "id" => $a_fallback_id);
}
// same installation?
if ($inst_id == IL_INST_ID) {
// still existing?
if (ilObject::_lookupType($id) == $type) {
return array("type" => self::EXPORT_ID_ILIAS_LOCAL, "id" => $id);
} else {
return array("type" => self::EXPORT_ID_ILIAS_LOCAL_INVALID, "id" => $a_fallback_id);
}
} else {
$id = ilObject::_getIdForImportId($a_id);
// matching type?
if ($id && ilObject::_lookupType($id) == $type) {
return array("type" => self::EXPORT_ID_ILIAS_REMOTE, "id" => $id);
} else {
return array("type" => self::EXPORT_ID_ILIAS_REMOTE_INVALID, "id" => $a_fallback_id);
}
}
}
// external id
$id = ilObject::_getIdForImportId($a_id);
if ($id) {
return array("type" => self::EXPORT_ID, "id" => $id);
} else {
return array("type" => self::EXPORT_ID_INVALID, "id" => $a_fallback_id);
}
}