getById($assocId); if (!$issueGalley) { throw new Exception('Cannot load record: invalid issue galley id.'); } $assocObjType = ASSOC_TYPE_ISSUE; $assocObjId = $issueGalley->getIssueId(); $isFile = true; // Don't break but go on to retrieve the issue. case ASSOC_TYPE_ISSUE: if (!$isFile) { $assocObjType = $assocObjId = null; $issueId = $assocId; } else { $issueId = $assocObjId; } $issueDao = DAORegistry::getDAO('IssueDAO'); $issue = $issueDao->getById($issueId); if (!$issue) { throw new Exception('Cannot load record: invalid issue id.'); } $contextId = $issue->getJournalId(); break; } } return array($contextId, $sectionId, $assocObjType, $assocObjId, $submissionId, $representationId); } /** * @copydoc PKPMetricsDAO::getAssocObjectInfo() */ protected function getAssocObjectInfo($submissionId, $contextId) { $returnArray = parent::getAssocObjectInfo($submissionId, $contextId); // Submissions in OJS are associated with an Issue. $publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO'); $publishedArticle = $publishedArticleDao->getByArticleId($submissionId, $contextId, true); if ($publishedArticle) { $returnArray = array(ASSOC_TYPE_ISSUE, $publishedArticle->getIssueId()); } return $returnArray; } } ?>