[OJS 2.4]
Hi,
I am writing a plugin, which updates PDF Galleys. After generating the new PDF I do the following:
$galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
$galley = new ArticleGalley();
$galley->setLabel('PDF');
$galley->setArticleId($articleId);
$galley->setLocale($oldGalley->getLocale());
import('classes.file.ArticleFileManager');
$articleFileManager = new ArticleFileManager(articleId);
$fileId = $articleFileManager->copyPublicFile($newFile, 'application/pdf');
$galley->setFileId($fileId);
$galleyDao->insertGalley($galley);
$galleyDao->deleteGalley($oldGalley);
It works like a charm - except for one thing: The old Galleys are removed now (not the files, but the entries in the DB). In fact I would like to archive them non-public, so that the Admin could revert the process if desired. I see that if I would use $galleyDao->updateGalley it would happen pretty much the same. So is there a mechanic I overlooked, which I could use to store the old galley somehow in the history or something like that?
Thank you in advance and thank you so much for all the previous support by the way!