本文整理汇总了PHP中Issue::setCurrent方法的典型用法代码示例。如果您正苦于以下问题:PHP Issue::setCurrent方法的具体用法?PHP Issue::setCurrent怎么用?PHP Issue::setCurrent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Issue
的用法示例。
在下文中一共展示了Issue::setCurrent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Issue
/**
* creates and returns an issue object from a row
* @param $row array
* @return Issue object
*/
function &_returnIssueFromRow($row)
{
$issue = new Issue();
$issue->setId($row['issue_id']);
$issue->setJournalId($row['journal_id']);
$issue->setVolume($row['volume']);
$issue->setNumber($row['number']);
$issue->setYear($row['year']);
$issue->setPublished($row['published']);
$issue->setCurrent($row['current']);
$issue->setDatePublished($this->datetimeFromDB($row['date_published']));
$issue->setDateNotified($this->datetimeFromDB($row['date_notified']));
$issue->setAccessStatus($row['access_status']);
$issue->setOpenAccessDate($this->datetimeFromDB($row['open_access_date']));
$issue->setPublicIssueId($row['public_issue_id']);
$issue->setShowVolume($row['show_volume']);
$issue->setShowNumber($row['show_number']);
$issue->setShowYear($row['show_year']);
$issue->setShowTitle($row['show_title']);
$issue->setStyleFileName($row['style_file_name']);
$issue->setOriginalStyleFileName($row['original_style_file_name']);
$this->getDataObjectSettings('issue_settings', 'issue_id', $row['issue_id'], $issue);
HookRegistry::call('IssueDAO::_returnIssueFromRow', array(&$issue, &$row));
return $issue;
}
示例2: importIssue
//.........这里部分代码省略.........
$issue->setShowNumber(0);
$issue->setShowYear(0);
$issue->setShowTitle(1);
break;
default:
$errors[] = array('plugins.importexport.native.import.error.unknownIdentificationType', array('identificationType' => $value, 'issueTitle' => $issue->getLocalizedTitle()));
$hasErrors = true;
break;
}
if (($issueNode->getAttribute('identification') == 'title' || $issueNode->getAttribute('identification') == '') && !$titleExists) {
$errors[] = array('plugins.importexport.native.import.error.titleMissing', array());
// Set a placeholder title so that further errors are
// somewhat meaningful; this placeholder will not be
// inserted into the database.
$issue->setTitle(__('plugins.importexport.native.import.error.defaultTitle'), $journalPrimaryLocale);
$hasErrors = true;
}
switch ($value = $issueNode->getAttribute('published')) {
case 'true':
$issue->setPublished(1);
break;
case 'false':
case '':
case null:
$issue->setPublished(0);
break;
default:
$errors[] = array('plugins.importexport.native.import.error.invalidBooleanValue', array('value' => $value));
$hasErrors = true;
break;
}
switch ($value = $issueNode->getAttribute('current')) {
case 'true':
$issue->setCurrent(1);
break;
case 'false':
case '':
case null:
$issue->setCurrent(0);
break;
default:
$errors[] = array('plugins.importexport.native.import.error.invalidBooleanValue', array('value' => $value));
$hasErrors = true;
break;
}
if (($value = $issueNode->getAttribute('public_id')) != '') {
$anotherIssue = $issueDao->getIssueByPublicIssueId($value, $journal->getId());
if ($anotherIssue) {
$errors[] = array('plugins.importexport.native.import.error.duplicatePublicId', array('issueTitle' => $issue->getIssueIdentification(), 'otherIssueTitle' => $anotherIssue->getIssueIdentification()));
$hasErrors = true;
} else {
$issue->setPublicIssueId($value);
}
}
/* --- Access Status --- */
$node = $issueNode->getChildByName('open_access');
$issue->setAccessStatus($node ? ISSUE_ACCESS_OPEN : ISSUE_ACCESS_SUBSCRIPTION);
if ($node = $issueNode->getChildByName('access_date')) {
$accessDate = strtotime($node->getValue());
if ($accessDate === -1) {
$errors[] = array('plugins.importexport.native.import.error.invalidDate', array('value' => $node->getValue()));
$hasErrors = true;
} else {
$issue->setOpenAccessDate($accessDate);
}
}
示例3: importIssues
function importIssues()
{
assert($this->xml->name == 'issues');
$issueDAO =& DAORegistry::getDAO('IssueDAO');
$issueFileDAO =& DAORegistry::getDAO('IssueFileDAO');
$issueGalleyDAO =& DAORegistry::getDAO('IssueGalleyDAO');
$sectionDAO =& DAORegistry::getDAO('SectionDAO');
$issues = $issueDAO->getIssues($this->journal->getId());
$publicFileManager =& new PublicFileManager();
$this->nextElement();
while ($this->xml->name == 'issue') {
$issueXML = $this->getCurrentElementAsDom();
$issue = new Issue();
$issue->setJournalId($this->journal->getId());
$issue->setVolume((int) $issueXML->volume);
$issue->setNumber((string) $issueXML->number);
$issue->setYear((int) $issueXML->year);
$issue->setPublished((int) $issueXML->published);
$issue->setCurrent((int) $issueXML->current);
$issue->setDatePublished((string) $issueXML->datePublished);
$issue->setDateNotified((string) $issueXML->dateNotified);
$issue->setLastModified((string) $issueXML->lastModified);
$issue->setAccessStatus((int) $issueXML->accessStatus);
$issue->setOpenAccessDate((string) $issueXML->openAccessDate);
$issue->setShowVolume((int) $issueXML->showVolume);
$issue->setShowNumber((int) $issueXML->showNumber);
$issue->setShowYear((int) $issueXML->showYear);
$issue->setShowTitle((int) $issueXML->showTitle);
$issue->setStyleFileName((string) $issueXML->styleFileName);
$issue->setOriginalStyleFileName((string) $issueXML->originalStyleFileName);
$oldIssueId = (int) $issueXML->oldId;
$issueDAO->insertIssue($issue);
//$issueDAO->insertCustomIssueOrder($this->journal->getId(), $issue->getId(), (int)$issueXML->customOrder);
$this->idTranslationTable->register(INTERNAL_TRANSFER_OBJECT_ISSUE, $oldIssueId, $issue->getId());
$this->restoreDataObjectSettings($issueDAO, $issueXML->settings, 'issue_settings', 'issue_id', $issue->getId());
$issue =& $issueDAO->getIssueById($issue->getId());
// Reload issue to get restored settings
$covers = $issue->getFileName(null);
if ($covers) {
foreach ($covers as $locale => $oldCoverFileName) {
$sourceFile = $this->publicFolderPath . '/' . $oldCoverFileName;
$extension = $publicFileManager->getExtension($oldCoverFileName);
$destFile = 'cover_issue_' . $issue->getId() . "_{$locale}.{$extension}";
$publicFileManager->copyJournalFile($this->journal->getId(), $sourceFile, $destFile);
unlink($sourceFile);
$issue->setFileName($destFile, $locale);
$issueDAO->updateIssue($issue);
}
}
if ($issue->getStyleFileName()) {
$oldStyleFileName = $issue->getStyleFileName();
$sourceFile = $this->publicFolderPath . '/' . $oldStyleFileName;
$destFile = 'style_' . $issue->getId() . '.css';
$publicFileManager->copyJournalFile($this->journal->getId(), $sourceFile, $destFile);
unlink($sourceFile);
$issue->setStyleFileName($destFile);
$issueDAO->updateIssue($issue);
}
$issueFileManager = new IssueFileManager($issue->getId());
foreach ($issueXML->issueFile as $issueFileXML) {
$issueFile = new IssueFile();
$issueFile->setIssueId($issue->getId());
$issueFile->setFileName((string) $issueFileXML->fileName);
$issueFile->setFileType((string) $issueFileXML->fileType);
$issueFile->setFileSize((int) $issueFileXML->fileSize);
$issueFile->setContentType((string) $issueFileXML->contentType);
$issueFile->setOriginalFileName((string) $issueFileXML->originalFileName);
$issueFile->setDateUploaded((string) $issueFileXML->dateUploaded);
$issueFile->setDateModified((string) $issueFileXML->dateModified);
$issueFileDAO->insertIssueFile($issueFile);
$oldFileName = $issueFile->getFileName();
$extension = $issueFileManager->parseFileExtension($oldFileName);
$contentPath = $issueFileManager->contentTypeToPath($issueFile->getContentType());
$contentAbbrev = $issueFileManager->contentTypeToAbbrev($issueFile->getContentType());
$fileInTransferPackage = $this->journalFolderPath . "/issues/{$oldIssueId}/{$contentPath}/{$oldFileName}";
$newFileName = $issue->getId() . '-' . $issueFile->getId() . '-' . $contentAbbrev . '.' . $extension;
$newFilePath = "{$contentPath}/{$newFileName}";
$issueFileManager->copyFile($fileInTransferPackage, $issueFileManager->getFilesDir() . $newFilePath);
unlink($fileInTransferPackage);
$issueFile->setFileName($newFileName);
$issueFileDAO->updateIssueFile($issueFile);
$this->idTranslationTable->register(INTERNAL_TRANSFER_OBJECT_ISSUE_FILE, (int) $issueFileXML->oldId, $issueFile->getId());
}
foreach ($issueXML->issueGalley as $issueGalleyXML) {
$issueGalley = new issueGalley();
$issueGalley->setIssueId($issue->getId());
$issueGalley->setLocale((string) $issueGalleyXML->locale);
$issueGalley->setFileId($this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_ISSUE_FILE, (int) $issueGalleyXML->fileId));
$issueGalley->setLabel((string) $issueGalleyXML->label);
$issueGalley->setSequence((int) $issueGalleyXML->sequence);
$issueGalleyDAO->insertGalley($issueGalley);
$this->idTranslationTable->register(INTERNAL_TRANSFER_OBJECT_ISSUE_GALLEY, (int) $issueGalleyXML->oldId, $issueGalley->getId());
$this->restoreDataObjectSettings($issueGalleyDAO, $issueGalleyXML->settings, 'issue_galley_settings', 'galley_id', $issueGalley->getId());
}
if (isset($issueXML->customSectionOrder)) {
foreach ($issueXML->customSectionOrder->sectionOrder as $sectionOrderXML) {
try {
$sectionId = $this->idTranslationTable->resolve(INTERNAL_TRANSFER_OBJECT_SECTION, (int) $sectionOrderXML['sectionId']);
$seq = (int) $sectionOrderXML['seq'];
$sectionDAO->insertCustomSectionOrder($issue->getId(), $sectionId, $seq);
//.........这里部分代码省略.........