deleteById() public method

Delete a submission by ID.
public deleteById ( $submissionId )
$submissionId int
Beispiel #1
0
 /**
  * @copydoc SubmissionDAO::deleteById
  */
 function deleteById($submissionId)
 {
     parent::deleteById($submissionId);
     $publishedMonographDao = DAORegistry::getDAO('PublishedMonographDAO');
     $publishedMonographDao->deleteById($submissionId);
     // Delete chapters and assigned chapter authors.
     $chapterDao = DAORegistry::getDAO('ChapterDAO');
     $chapters = $chapterDao->getChapters($submissionId);
     while ($chapter = $chapters->next()) {
         // also removes Chapter Author associations
         $chapterDao->deleteObject($chapter);
     }
     // Delete references to features or new releases.
     $featureDao = DAORegistry::getDAO('FeatureDAO');
     $featureDao->deleteByMonographId($submissionId);
     $newReleaseDao = DAORegistry::getDAO('NewReleaseDAO');
     $newReleaseDao->deleteByMonographId($submissionId);
     import('classes.search.MonographSearchIndex');
     MonographSearchIndex::deleteTextIndex($submissionId);
 }
Beispiel #2
0
 /**
  * @copydoc Submission::deleteById
  */
 function deleteById($submissionId)
 {
     parent::deleteById($submissionId);
     $publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
     $publishedArticleDao->deletePublishedArticleByArticleId($submissionId);
     $articleGalleyDao = DAORegistry::getDAO('ArticleGalleyDAO');
     $articleGalleyDao->deleteByArticleId($submissionId);
     $articleSearchDao = DAORegistry::getDAO('ArticleSearchDAO');
     $articleSearchDao->deleteSubmissionKeywords($submissionId);
     // Delete article citations.
     $citationDao = DAORegistry::getDAO('CitationDAO');
     $citationDao->deleteObjectsByAssocId(ASSOC_TYPE_ARTICLE, $submissionId);
     import('classes.search.ArticleSearchIndex');
     $articleSearchIndex = new ArticleSearchIndex();
     $articleSearchIndex->articleDeleted($submissionId);
     $articleSearchIndex->articleChangesFinished();
     $this->flushCache();
 }
Beispiel #3
0
 /**
  * Delete an article by ID.
  * @param $articleId int
  */
 function deleteById($articleId)
 {
     parent::deleteById($articleId);
     $publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
     $publishedArticleDao->deletePublishedArticleByArticleId($articleId);
     $articleGalleyDao = DAORegistry::getDAO('ArticleGalleyDAO');
     $articleGalleyDao->deleteGalleysByArticle($articleId);
     $articleSearchDao = DAORegistry::getDAO('ArticleSearchDAO');
     $articleSearchDao->deleteSubmissionKeywords($articleId);
     $commentDao = DAORegistry::getDAO('CommentDAO');
     $commentDao->deleteBySubmissionId($submissionId);
     // Delete article files -- first from the filesystem, then from the database
     import('classes.file.ArticleFileManager');
     $articleFileDao = DAORegistry::getDAO('ArticleFileDAO');
     $articleFiles = $articleFileDao->getArticleFilesByArticle($articleId);
     $articleFileManager = new ArticleFileManager($articleId);
     foreach ($articleFiles as $articleFile) {
         $articleFileManager->deleteFile($articleFile->getFileId());
     }
     $articleFileDao->deleteArticleFiles($articleId);
     // Delete article citations.
     $citationDao = DAORegistry::getDAO('CitationDAO');
     $citationDao->deleteObjectsByAssocId(ASSOC_TYPE_ARTICLE, $articleId);
     import('classes.search.ArticleSearchIndex');
     $articleSearchIndex = new ArticleSearchIndex();
     $articleSearchIndex->articleDeleted($articleId);
     $articleSearchIndex->articleChangesFinished();
     $this->flushCache();
 }