本文整理汇总了PHP中Note::setFileId方法的典型用法代码示例。如果您正苦于以下问题:PHP Note::setFileId方法的具体用法?PHP Note::setFileId怎么用?PHP Note::setFileId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Note
的用法示例。
在下文中一共展示了Note::setFileId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: importArticles
//.........这里部分代码省略.........
$articleFile->setFileStage((int) $articleFileXML->fileStage);
$articleFile->setAssocId($this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_ARTICLE_EMAIL_LOG, (int) $articleFileXML->assocId));
$articleFile->setDateUploaded((string) $articleFileXML->dateUploaded);
$articleFile->setDateModified((string) $articleFileXML->dateModified);
$articleFile->setRound((int) $articleFileXML->round);
$articleFile->setViewable((int) $articleFileXML->viewable);
$articleFileDAO->insertArticleFile($articleFile);
$oldArticleFileId = (int) $articleFileXML->oldId;
$oldFileName = $articleFile->getFileName();
$stagePath = $articleFileManager->fileStageToPath($articleFile->getFileStage());
$fileInTransferPackage = $this->journalFolderPath . "/articles/{$oldArticleId}/{$stagePath}/{$oldFileName}";
$newFileName = $articleFileManager->generateFilename($articleFile, $articleFile->getFileStage(), $articleFile->getOriginalFileName());
$newFilePath = "/articles/" . $article->getId() . "/{$stagePath}/{$newFileName}";
$journalFileManager->copyFile($fileInTransferPackage, $journalFileManager->filesDir . $newFilePath);
unlink($fileInTransferPackage);
$articleFileDAO->updateArticleFile($articleFile);
$this->idTranslationTable->register(INTERNAL_TRANSFER_OBJECT_ARTICLE_FILE, $oldArticleFileId, $articleFile->getFileId());
} catch (Exception $e) {
}
}
$articleFiles = $articleFileDAO->getArticleFilesByArticle($article->getId());
foreach ($articleFiles as $articleFile) {
try {
$articleFile->setSourceFileId($this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_ARTICLE_FILE, $articleFile->getSourceFileId()));
$articleFileDAO->updateArticleFile($articleFile);
} catch (Exception $e) {
}
}
$suppFileDAO =& DAORegistry::getDAO('SuppFileDAO');
foreach ($articleXML->suppFile as $suppFileXML) {
$suppFile =& new SuppFile();
$suppFile->setArticleId($article->getId());
$suppFile->setRemoteURL((string) $suppFileXML->remoteURL);
$suppFile->setFileId($this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_ARTICLE_FILE, (int) $suppFileXML->fileId));
$suppFile->setType((string) $suppFileXML->type);
$suppFile->setDateCreated((string) $suppFileXML->dateCreated);
$suppFile->setLanguage((string) $suppFileXML->language);
$suppFile->setShowReviewers((int) $suppFileXML->showReviewers);
$suppFile->setDateSubmitted((string) $suppFileXML->dateSubmitted);
$suppFile->setSequence((int) $suppFileXML->sequence);
$suppFileDAO->insertSuppFile($suppFile);
$this->restoreDataObjectSettings($suppFileDAO, $suppFileXML->settings, 'article_supp_file_settings', 'supp_id', $suppFile->getId());
}
$articleCommentDAO =& DAORegistry::getDAO('ArticleCommentDAO');
foreach ($articleXML->articleComment as $articleCommentXML) {
$articleComment = new ArticleComment();
$articleComment->setArticleId($article->getId());
$articleComment->setAssocId($article->getId());
$articleComment->setCommentType((int) $articleCommentXML->commentType);
$articleComment->setRoleId((int) $articleCommentXML->roleId);
$articleComment->setAuthorId($this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_USER, (int) $articleCommentXML->authorId));
$articleComment->setCommentTitle((string) $articleCommentXML->commentTitle);
$articleComment->setComments((string) $articleCommentXML->comments);
$articleComment->setDatePosted((string) $articleCommentXML->datePosted);
$articleComment->setDateModified((string) $articleCommentXML->dateModified);
$articleComment->setViewable((int) $articleCommentXML->viewable);
$articleCommentDAO->insertArticleComment($articleComment);
}
$articleGalleyDAO =& DAORegistry::getDAO('ArticleGalleyDAO');
foreach ($articleXML->articleGalley as $articleGalleyXML) {
$articleGalley = null;
if ($articleGalleyXML->htmlGalley == "1") {
$articleGalley = new ArticleHTMLGalley();
} else {
$articleGalley = new ArticleGalley();
}
示例2: updateSubmissionNote
/**
* Updates Submission Note
* @param $articleId int
*/
function updateSubmissionNote($articleId, $request)
{
import('classes.file.ArticleFileManager');
$noteDao =& DAORegistry::getDAO('NoteDAO');
$user =& $request->getUser();
$journal =& $request->getJournal();
$note = new Note();
$note->setId($request->getUserVar('noteId'));
$note->setAssocType(ASSOC_TYPE_ARTICLE);
$note->setAssocId($articleId);
$note->setUserId($user->getId());
$note->setDateModified(Core::getCurrentDate());
$note->setContextId($journal->getId());
$note->setTitle($request->getUserVar('title'));
$note->setContents($request->getUserVar('note'));
$note->setFileId($request->getUserVar('fileId'));
if (HookRegistry::call('SectionEditorAction::updateSubmissionNote', array(&$articleId, &$note))) {
return;
}
$articleFileManager = new ArticleFileManager($articleId);
// if there is a new file being uploaded
if ($articleFileManager->uploadedFileExists('upload')) {
// Attach the new file to the note, overwriting existing file if necessary
$fileId = $articleFileManager->uploadSubmissionNoteFile('upload', $note->getFileId(), true);
$note->setFileId($fileId);
} else {
if ($request->getUserVar('removeUploadedFile')) {
$articleFileManager = new ArticleFileManager($articleId);
$articleFileManager->deleteFile($note->getFileId());
$note->setFileId(0);
}
}
$noteDao->updateObject($note);
}
示例3: updateSubmissionNote
/**
* Updates Submission Note
* @param $paperId int
*/
function updateSubmissionNote($paperId)
{
import('classes.file.PaperFileManager');
$noteDao = DAORegistry::getDAO('NoteDAO');
$user =& Request::getUser();
$conference =& Request::getConference();
$note = new Note();
$note->setId(Request::getUserVar('noteId'));
$note->setAssocType(ASSOC_TYPE_PAPER);
$note->setAssocId($paperId);
$note->setUserId($user->getId());
$note->setDateModified(Core::getCurrentDate());
$note->setContextId($conference->getId());
$note->setTitle(Request::getUserVar('title'));
$note->setContents(Request::getUserVar('note'));
$note->setFileId(Request::getUserVar('fileId'));
if (HookRegistry::call('SectionEditorAction::updateSubmissionNote', array(&$paperId, &$note))) {
return;
}
$paperFileManager = new PaperFileManager($paperId);
// if there is a new file being uploaded
if ($paperFileManager->uploadedFileExists('upload')) {
// Attach the new file to the note, overwriting existing file if necessary
$fileId = $paperFileManager->uploadSubmissionNoteFile('upload', $note->getFileId(), true);
$note->setFileId($fileId);
} else {
if (Request::getUserVar('removeUploadedFile')) {
$paperFileManager = new PaperFileManager($paperId);
$paperFileManager->deleteFile($note->getFileId());
$note->setFileId(0);
}
}
$noteDao->updateObject($note);
}