本文整理汇总了PHP中ilLMObject::_writeTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP ilLMObject::_writeTitle方法的具体用法?PHP ilLMObject::_writeTitle怎么用?PHP ilLMObject::_writeTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilLMObject
的用法示例。
在下文中一共展示了ilLMObject::_writeTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveTitles
/**
* Save titles for lm objects
*
* @param array titles (key is ID, value is title)
*/
static function saveTitles($a_lm, $a_titles, $a_lang = "-")
{
include_once "./Modules/LearningModule/classes/class.ilLMObjTranslation.php";
if ($a_lang == "") {
$a_lang = "-";
}
if (is_array($a_titles)) {
include_once "./Services/MetaData/classes/class.ilMD.php";
foreach ($a_titles as $id => $title) {
if ($a_lang == "-") {
$lmobj = ilLMObjectFactory::getInstance($a_lm, $id, false);
if (is_object($lmobj)) {
// Update Title and description
$md = new ilMD($a_lm->getId(), $id, $lmobj->getType());
$md_gen = $md->getGeneral();
if (is_object($md_gen)) {
$md_gen->setTitle($title);
$md_gen->update();
$md->update();
}
ilLMObject::_writeTitle($id, $title);
}
} else {
$lmobjtrans = new ilLMObjTranslation($id, $a_lang);
$lmobjtrans->setTitle($title);
$lmobjtrans->save();
}
}
}
}
示例2: saveTitles
/**
* Save titles for lm objects
*
* @param array titles (key is ID, value is title)
*/
static function saveTitles($a_lm, $a_titles)
{
if (is_array($a_titles)) {
include_once "./Services/MetaData/classes/class.ilMD.php";
foreach ($a_titles as $id => $title) {
$lmobj = ilLMObjectFactory::getInstance($a_lm, $id, false);
if (is_object($lmobj)) {
// Update Title and description
$md = new ilMD($a_lm->getId(), $id, $lmobj->getType());
$md_gen = $md->getGeneral();
$md_gen->setTitle($title);
$md_gen->update();
$md->update();
ilLMObject::_writeTitle($id, $title);
}
}
}
}