本文整理汇总了PHP中Note::setContents方法的典型用法代码示例。如果您正苦于以下问题:PHP Note::setContents方法的具体用法?PHP Note::setContents怎么用?PHP Note::setContents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Note
的用法示例。
在下文中一共展示了Note::setContents方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: importArticles
//.........这里部分代码省略.........
$articleGalley = null;
if ($articleGalleyXML->htmlGalley == "1") {
$articleGalley = new ArticleHTMLGalley();
} else {
$articleGalley = new ArticleGalley();
}
$articleGalley->setArticleId($article->getId());
$articleGalley->setLocale((string) $articleGalleyXML->locale);
$articleGalley->setFileId($this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_ARTICLE_FILE, (int) $articleGalleyXML->fileId));
$articleGalley->setLabel((string) $articleGalleyXML->label);
$articleGalley->setSequence((int) $articleGalleyXML->sequence);
$articleGalley->setRemoteURL((string) $articleGalleyXML->remoteURL);
if ($articleGalley instanceof ArticleHTMLGalley) {
$articleGalley->setStyleFileId($this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_ARTICLE_FILE, (int) $articleGalleyXML->styleFileId));
}
$articleGalleyDAO->insertGalley($articleGalley);
if ($articleGalley instanceof ArticleHTMLGalley) {
foreach ($articleGalleyXML->htmlGalleyImage as $articleGalleyImageXML) {
$imageId = $this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_ARTICLE_FILE, (int) $articleGalleyImageXML);
$articleGalleyDAO->insertGalleyImage($articleGalley->getId(), $imageId);
}
}
$this->restoreDataObjectSettings($articleGalleyDAO, $articleGalleyXML->settings, 'article_galley_settings', 'galley_id', $articleGalley->getId());
}
$noteDAO =& DAORegistry::getDAO('NoteDAO');
foreach ($articleXML->articleNote as $articleNoteXML) {
$articleNote = new Note();
$articleNote->setUserId($this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_USER, (int) $articleNoteXML->userId));
$articleNote->setFileId($this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_ARTICLE_FILE, (int) $articleNoteXML->fileId));
$articleNote->setAssocType(ASSOC_TYPE_ARTICLE);
$articleNote->setAssocId($article->getId());
$articleNote->setDateCreated((string) $articleNoteXML->dateCreated);
$articleNote->setDateModified((string) $articleNoteXML->dateModified);
$articleNote->setContents((string) $articleNoteXML->contents);
$articleNote->setTitle((string) $articleNoteXML->title);
$noteDAO->insertObject($articleNote);
}
$editAssignmentDAO =& DAORegistry::getDAO('EditAssignmentDAO');
foreach ($articleXML->editAssignment as $editAssignmentXML) {
$editAssignment = new EditAssignment();
$editAssignment->setArticleId($article->getId());
$editAssignment->setEditorId($this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_USER, (int) $editAssignmentXML->editorId));
$editAssignment->setCanReview((int) $editAssignmentXML->canReview);
$editAssignment->setCanEdit((int) $editAssignmentXML->canEdit);
$editAssignment->setDateUnderway((string) $editAssignmentXML->dateUnderway);
$editAssignment->setDateNotified((string) $editAssignmentXML->dateNotified);
$editAssignmentDAO->insertEditAssignment($editAssignment);
}
$reviewAssignmentDAO =& DAORegistry::getDAO('ReviewAssignmentDAO');
$reviewFormResponseDAO =& DAORegistry::getDAO('ReviewFormResponseDAO');
foreach ($articleXML->reviewAssignment as $reviewAssignmentXML) {
$reviewAssignment = new ReviewAssignment();
$reviewAssignment->setSubmissionId($article->getId());
$reviewAssignment->setReviewerId($this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_USER, (int) $reviewAssignmentXML->reviewerId));
try {
$reviewAssignment->setReviewerFileId($this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_ARTICLE_FILE, (int) $reviewAssignmentXML->reviewerFileId));
} catch (Exception $e) {
$this->logger->log("Arquivo do artigo {$oldArticleId} não encontrado. ID: " . (int) $reviewAssignmentXML->reviewerFileId . "\n");
}
$reviewAssignment->setReviewFormId($this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_REVIEW_FORM, (int) $reviewAssignmentXML->reviewFormId));
$reviewAssignment->setReviewRoundId((int) $reviewAssignmentXML->reviewRoundId);
$reviewAssignment->setStageId((int) $reviewAssignmentXML->stageId);
$reviewAssignment->setReviewerFullName((string) $reviewAssignmentXML->reviewerFullName);
$reviewAssignment->setCompetingInterests((string) $reviewAssignmentXML->competingInterests);
$reviewAssignment->setRegretMessage((string) $reviewAssignmentXML->regretMessage);
$reviewAssignment->setRecommendation((string) $reviewAssignmentXML->recommendation);
示例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);
}