function clearIssueObjectsPubIds($issue)
{
$issueId = $issue->getId();
$submissionPubIdEnabled = $this->isObjectTypeEnabled('Submission', $issue->getJournalId());
$representationPubIdEnabled = $this->isObjectTypeEnabled('Representation', $issue->getJournalId());
$filePubIdEnabled = $this->isObjectTypeEnabled('SubmissionFile', $issue->getJournalId());
if (!$submissionPubIdEnabled && !$representationPubIdEnabled && !$filePubIdEnabled) {
return false;
}
$pubIdType = $this->getPubIdType();
$publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
$representationDao = Application::getRepresentationDAO();
$submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO');
import('lib.pkp.classes.submission.SubmissionFile');
// SUBMISSION_FILE_... constants
$publishedArticles = $publishedArticleDao->getPublishedArticles($issueId);
foreach ($publishedArticles as $publishedArticle) {
if ($submissionPubIdEnabled) {
// Does this option have to be enabled here for?
$publishedArticleDao->deletePubId($publishedArticle->getId(), $pubIdType);
}
if ($representationPubIdEnabled || $filePubIdEnabled) {
// Does this option have to be enabled here for?
$representations = $representationDao->getBySubmissionId($publishedArticle->getId());
while ($representation = $representations->next()) {
if ($representationPubIdEnabled) {
// Does this option have to be enabled here for?
$representationDao->deletePubId($representation->getId(), $pubIdType);
}
if ($filePubIdEnabled) {
// Does this option have to be enabled here for?
$articleProofFiles = $submissionFileDao->getAllRevisionsByAssocId(ASSOC_TYPE_REPRESENTATION, $representation->getId(), SUBMISSION_FILE_PROOF);
foreach ($articleProofFiles as $articleProofFile) {
$submissionFileDao->deletePubId($articleProofFile->getFileId(), $pubIdType);
}
}
}
unset($representations);
}
}
}