本文整理汇总了PHP中ilObjFile::update方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjFile::update方法的具体用法?PHP ilObjFile::update怎么用?PHP ilObjFile::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjFile
的用法示例。
在下文中一共展示了ilObjFile::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: importXmlRepresentation
/**
* Import XML
*
* @param
* @return
*/
function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
{
include_once './Modules/File/classes/class.ilObjFile.php';
// case i container
if ($new_id = $a_mapping->getMapping('Services/Container', 'objs', $a_id)) {
$newObj = ilObjectFactory::getInstanceByObjId($new_id, false);
} else {
$newObj = new ilObjFile();
$newObj->create(true);
}
include_once "./Modules/File/classes/class.ilFileXMLParser.php";
$parser = new ilFileXMLParser($newObj, $a_xml);
$parser->setImportDirectory($this->getImportDirectory());
$parser->startParsing();
$newObj->createProperties(false, false);
$parser->setFileContents();
$this->current_obj = $newObj;
$newObj->update();
// this is necessary for case ii (e.g. wiki import)
$a_mapping->addMapping("Modules/File", "file", $a_id, $newObj->getId());
$a_mapping->addMapping("Services/MetaData", "md", $a_id . ":0:file", $newObj->getId() . ":0:file");
}
示例2: copyFileItems
/**
* copy files of file items
*/
function copyFileItems()
{
$imp_dir = $this->content_object->getImportDirectory();
foreach ($this->file_item_mapping as $origin_id => $file_id) {
if (empty($origin_id)) {
continue;
}
$obj_dir = $origin_id;
$source_dir = $imp_dir . "/" . $this->subdir . "/objects/" . $obj_dir;
include_once "./Modules/File/classes/class.ilObjFile.php";
$file_obj = new ilObjFile($file_id, false);
//$target_dir = ilUtil::getDataDir()."/files/file_".$file_id;
$target_dir = $file_obj->getDirectory();
if (@is_dir($source_dir)) {
// make target directory
ilUtil::makeDir($target_dir);
//@mkdir($target_dir);
//@chmod($target_dir, 0755);
if (@is_dir($target_dir)) {
ilUtil::rCopy($source_dir, $target_dir);
}
}
$test = $file_obj->determineFilesize();
$file_obj->update();
}
}