Open Journal Systems  2.4.4
 All Classes Namespaces Functions Variables Groups Pages
PKPSubmissionFileDAO.inc.php
1 <?php
2 
33 import('lib.pkp.classes.file.PKPFileDAO');
34 
35 
41  var $_delegates = array();
42 
46  function PKPSubmissionFileDAO() {
47  parent::DAO();
48  }
49 
50 
51  //
52  // Public methods
53  //
63  function &getRevision($fileId, $revision, $fileStage = null, $submissionId = null) {
64  if (!($fileId && $revision)) {
65  $nullVar = null;
66  return $nullVar;
67  }
68  $revisions =& $this->_getInternally($submissionId, $fileStage, $fileId, $revision);
69  return $this->_checkAndReturnRevision($revisions);
70  }
71 
72 
82  function &getLatestRevision($fileId, $fileStage = null, $submissionId = null) {
83  if (!$fileId) {
84  $nullVar = null;
85  return $nullVar;
86  }
87  $revisions =& $this->_getInternally($submissionId, $fileStage, $fileId, null, null, null, null, null, null, null, null, true);
88  return $this->_checkAndReturnRevision($revisions);
89  }
90 
99  function &getLatestRevisions($submissionId, $fileStage = null, $rangeInfo = null) {
100  if (!$submissionId) {
101  $nullVar = null;
102  return $nullVar;
103  }
104  return $this->_getInternally($submissionId, $fileStage, null, null, null, null, null, null, null, null, null, true, $rangeInfo);
105  }
106 
117  function &getAllRevisions($fileId, $fileStage = null, $submissionId = null, $rangeInfo = null) {
118  if (!$fileId) {
119  $nullVar = null;
120  return $nullVar;
121  }
122  return $this->_getInternally($submissionId, $fileStage, $fileId, null, null, null, null, null, null, null, null, false, $rangeInfo);
123  }
124 
135  function &getLatestRevisionsByAssocId($assocType, $assocId, $submissionId = null, $fileStage = null, $rangeInfo = null) {
136  if (!($assocType && $assocId)) {
137  $nullVar = null;
138  return $nullVar;
139  }
140  return $this->_getInternally($submissionId, $fileStage, null, null, $assocType, $assocId, null, null, null, null, null, true, $rangeInfo);
141  }
142 
152  function &getAllRevisionsByAssocId($assocType, $assocId, $fileStage = null, $rangeInfo = null) {
153  if (!($assocType && $assocId)) {
154  $nullVar = null;
155  return $nullVar;
156  }
157  return $this->_getInternally(null, $fileStage, null, null, $assocType, $assocId, null, null, null, null, null, false, $rangeInfo);
158  }
159 
171  function &getRevisionsByReviewRound($submissionId, $stageId, $round, $fileStage = null,
172  $uploaderUserId = null, $uploaderUserGroupId = null) {
173  if (!($stageId && $round)) {
174  $nullVar = null;
175  return $nullVar;
176  }
177  return $this->_getInternally($submissionId, $fileStage, null, null, null, null, $stageId, $uploaderUserId, $uploaderUserGroupId, $round);
178  }
179 
189  function &getLatestNewRevisionsByReviewRound($submissionId, $stageId, $round, $fileStage = null) {
190  if (!($stageId && $round)) {
191  $emptyArray = array();
192  return $emptyArray;
193  }
194  return $this->_getInternally($submissionId, $fileStage, null, null, null, null, $stageId, null, null, $round, null, true);
195  }
196 
202  function getLatestRevisionNumber($fileId) {
203  assert(!is_null($fileId));
204 
205  // Retrieve the latest revision from the database.
206  $result =& $this->retrieve(
207  'SELECT MAX(revision) AS max_revision FROM '.$this->getSubmissionEntityName().'_files WHERE file_id = ?',
208  $fileId
209  );
210  if($result->RecordCount() != 1) return null;
211 
212  $row =& $result->FetchRow();
213  $result->Close();
214  unset($result);
215 
216  $latestRevision = (int)$row['max_revision'];
217  assert($latestRevision > 0);
218  return $latestRevision;
219  }
220 
231  function &insertObject(&$submissionFile, $sourceFile, $isUpload = false) {
232  // Make sure that the implementation of the updated file
233  // is compatible with its genre (upcast but no downcast).
234  $submissionFile =& $this->_castToGenre($submissionFile);
235 
236  // Find the required target implementation and delegate.
237  $targetImplementation = strtolower_codesafe(
239  $submissionFile->getGenreId())
240  );
241  $targetDaoDelegate =& $this->_getDaoDelegate($targetImplementation);
242  $insertedFile =& $targetDaoDelegate->insertObject($submissionFile, $sourceFile, $isUpload);
243 
244  // If the updated file does not have the correct target type then we'll have
245  // to retrieve it again from the database to cast it to the right type (downcast).
246  if (strtolower_codesafe(get_class($insertedFile)) != $targetImplementation) {
247  $insertedFile =& $this->_castToDatabase($insertedFile);
248  }
249  return $insertedFile;
250  }
251 
270  function &updateObject(&$updatedFile, $previousFileId = null, $previousRevision = null) {
271  // Make sure that the implementation of the updated file
272  // is compatible with its genre.
273  $updatedFile =& $this->_castToGenre($updatedFile);
274 
275  // Complete the identifying data of the previous file if not given.
276  $previousFileId = (int)($previousFileId ? $previousFileId : $updatedFile->getFileId());
277  $previousRevision = (int)($previousRevision ? $previousRevision : $updatedFile->getRevision());
278 
279  // Retrieve the previous file.
280  $previousFile =& $this->getRevision($previousFileId, $previousRevision);
281  assert(is_a($previousFile, 'MonographFile'));
282 
283  // Canonicalized the implementation of the previous file.
284  $previousImplementation = strtolower_codesafe(get_class($previousFile));
285 
286  // Find the required target implementation and delegate.
287  $targetImplementation = strtolower_codesafe(
289  $updatedFile->getGenreId())
290  );
291  $targetDaoDelegate =& $this->_getDaoDelegate($targetImplementation);
292 
293  // If the implementation in the database differs from the target
294  // implementation then we'll have to delete + insert the object
295  // to make sure that the database contains consistent data.
296  if ($previousImplementation != $targetImplementation) {
297  // We'll have to copy the previous file to its target
298  // destination so that it is not lost when we delete the
299  // previous file.
300  // When the implementation (i.e. genre) changes then the
301  // file locations will also change so we should not get
302  // a file name clash.
303  $previousFilePath = $previousFile->getFilePath();
304  $targetFilePath = $updatedFile->getFilePath();
305  assert($previousFilePath != $targetFilePath && !file_exists($targetFilePath));
306  import('lib.pkp.classes.file.FileManager');
307  $fileManager = new FileManager();
308  $fileManager->copyFile($previousFilePath, $targetFilePath);
309 
310  // We use the delegates directly to make sure
311  // that we address the right implementation in the database
312  // on delete and insert.
313  $sourceDaoDelegate =& $this->_getDaoDelegate($previousImplementation);
314  $sourceDaoDelegate->deleteObject($previousFile);
315  $targetDaoDelegate->insertObject($updatedFile, $targetFilePath);
316  } else {
317  // If the implementation in the database does not change then we
318  // can do an efficient update.
319  if (!$targetDaoDelegate->updateObject($updatedFile, $previousFile)) {
320  $nullVar = null;
321  return $nullVar;
322  }
323  }
324 
325  // If the updated file does not have the correct target type then we'll have
326  // to retrieve it again from the database to cast it to the right type.
327  if (strtolower_codesafe(get_class($updatedFile)) != $targetImplementation) {
328  $updatedFile =& $this->_castToDatabase($updatedFile);
329  }
330 
331  return $updatedFile;
332  }
333 
346  function &setAsLatestRevision($revisedFileId, $newFileId, $submissionId, $fileStage) {
347  $revisedFileId = (int)$revisedFileId;
348  $newFileId = (int)$newFileId;
349  $submissionId = (int)$submissionId;
350  $fileStage = (int)$fileStage;
351 
352  // Check whether the two files are already revisions of each other.
353  $nullVar = null;
354  if ($revisedFileId == $newFileId) return $nullVar;
355 
356  // Retrieve the latest revisions of the two submission files.
357  $revisedFile =& $this->getLatestRevision($revisedFileId, $fileStage, $submissionId);
358  $newFile =& $this->getLatestRevision($newFileId, $fileStage, $submissionId);
359  if (!($revisedFile && $newFile)) return $nullVar;
360 
361  // Save identifying data of the changed file required for update.
362  $previousFileId = $newFile->getFileId();
363  $previousRevision = $newFile->getRevision();
364 
365  // Copy data over from the revised file to the new file.
366  $newFile->setFileId($revisedFileId);
367  $newFile->setRevision($revisedFile->getRevision()+1);
368  $newFile->setGenreId($revisedFile->getGenreId());
369  $newFile->setAssocType($revisedFile->getAssocType());
370  $newFile->setAssocId($revisedFile->getAssocId());
371 
372  // Update the file in the database.
373  return $this->updateObject($newFile, $previousFileId, $previousRevision);
374  }
375 
384  function assignRevisionToReviewRound($fileId, $revision, $stageId, $reviewRoundId, $submissionId) {
385  if (!is_numeric($fileId) || !is_numeric($revision)) fatalError('Invalid file!');
386  return $this->update('INSERT INTO review_round_files
387  ('.$this->getSubmissionEntityName().'_id, stage_id, review_round_id, file_id, revision)
388  VALUES (?, ?, ?, ?, ?)',
389  array((int)$submissionId, (int)$stageId, (int)$reviewRoundId, (int)$fileId, (int)$revision));
390  }
391 
397  function deleteRevision(&$submissionFile) {
398  return $this->deleteRevisionById($submissionFile->getFileId(), $submissionFile->getRevision(), $submissionFile->getFileStage(), $submissionFile->getSubmissionId());
399  }
400 
411  function deleteRevisionById($fileId, $revision, $fileStage = null, $submissionId = null) {
412  return $this->_deleteInternally($submissionId, $fileStage, $fileId, $revision);
413  }
414 
424  function deleteLatestRevisionById($fileId, $fileStage= null, $submissionId = null) {
425  return $this->_deleteInternally($submissionId, $fileStage, $fileId, null, null, null, null, null, null, null, true);
426  }
427 
438  function deleteAllRevisionsById($fileId, $fileStage = null, $submissionId = null) {
439  return $this->_deleteInternally($submissionId, $fileStage, $fileId);
440  }
441 
450  function deleteAllRevisionsBySubmissionId($submissionId, $fileStage = null) {
451  return $this->_deleteInternally($submissionId, $fileStage);
452  }
453 
462  function deleteAllRevisionsByAssocId($assocType, $assocId, $fileStage = null) {
463  return $this->_deleteInternally(null, $fileStage, null, null, $assocType, $assocId);
464  }
465 
473  function deleteAllRevisionsByReviewRound($submissionId, $stageId, $reviewRoundId) {
474  // Remove currently assigned review files.
475  return $this->update('DELETE FROM review_round_files
476  WHERE '.$this->getSubmissionEntityName().'_id = ? AND stage_id = ? AND review_round_id = ?',
477  array((int)$submissionId, (int)$stageId, (int)$reviewRoundId));
478  }
479 
488  function deleteReviewRoundAssignment($submissionId, $stageId, $fileId, $revision) {
489  // Remove currently assigned review files.
490  return $this->update('DELETE FROM review_round_files
491  WHERE '.$this->getSubmissionEntityName().'_id = ? AND stage_id = ? AND file_id = ? AND revision = ?',
492  array((int)$submissionId, (int)$stageId, (int)$fileId, (int)$revision));
493  }
494 
500  function transferOwnership($oldUserId, $newUserId) {
501  $submissionFiles =& $this->_getInternally(null, null, null, null, null, null, null, $oldUserId, null, null);
502  foreach ($submissionFiles as $file) {
503  $daoDelegate =& $this->_getDaoDelegateForObject($file);
504  $file->setUploaderUserId($newUserId);
505  $daoDelegate->updateObject($file, $file); // nothing else changes
506  }
507  }
508 
515  function &newDataObjectByGenreId($genreId) {
516  // Identify the delegate.
517  $daoDelegate =& $this->_getDaoDelegateForGenreId($genreId);
518 
519  // Instantiate and return the object.
520  $newSubmissionFile =& $daoDelegate->newDataObject();
521  return $newSubmissionFile;
522  }
523 
524 
525  //
526  // Abstract template methods to be implemented by subclasses.
527  //
534  assert(false);
535  }
536 
549  assert(false);
550  }
551 
559  assert(false);
560  }
561 
567  assert(false);
568  }
569 
570 
571  //
572  // Protected helper methods
573  //
580  function &fromRow(&$row, $fileImplementation) {
581  // Identify the delegate.
582  $daoDelegate =& $this->_getDaoDelegate($fileImplementation); /* @var $daoDelegate SubmissionFileDAODelegate */
583 
584  // Let the DAO delegate instantiate the file implementation.
585  return $daoDelegate->fromRow($row);
586  }
587 
588 
589  //
590  // Private helper methods
591  //
597  function &_getFileImplementationForGenreId($genreId) {
598  static $genreCache = array();
599 
600  if (!isset($genreCache[$genreId])) {
601  // We have to instantiate the genre to find out about
602  // its category.
603  $genreDao =& DAORegistry::getDAO('GenreDAO'); /* @var $genreDao GenreDAO */
604  $genre =& $genreDao->getById($genreId);
605 
606  // Identify the file implementation.
607  $genreMapping = $this->getGenreCategoryMapping();
608  assert(isset($genreMapping[$genre->getCategory()]));
609  $genreCache[$genreId] = $genreMapping[$genre->getCategory()];
610  }
611 
612  return $genreCache[$genreId];
613  }
614 
621  function &_getDaoDelegateForGenreId($genreId) {
622  // Find the required file implementation.
623  $fileImplementation = $this->_getFileImplementationForGenreId($genreId);
624 
625  // Return the DAO delegate.
626  return $this->_getDaoDelegate($fileImplementation);
627  }
628 
635  function &_getDaoDelegateForObject(&$object) {
636  return $this->_getDaoDelegate(get_class($object));
637  }
638 
646  function &_getDaoDelegate($fileImplementation) {
647  // Normalize the file implementation name.
648  $fileImplementation = strtolower_codesafe($fileImplementation);
649 
650  // Did we already instantiate the requested delegate?
651  if (!isset($this->_delegates[$fileImplementation])) {
652  // Instantiate the requested delegate.
653  $delegateClasses = $this->getDelegateClassNames();
654  assert(isset($delegateClasses[$fileImplementation]));
655  $delegateClass = $delegateClasses[$fileImplementation];
656  $this->_delegates[$fileImplementation] =& instantiate($delegateClass, 'SubmissionFileDAODelegate', null, null, $this);
657  }
658 
659  // Return the delegate.
660  return $this->_delegates[$fileImplementation];
661  }
662 
678  function &_getInternally($submissionId = null, $fileStage = null, $fileId = null, $revision = null,
679  $assocType = null, $assocId = null, $stageId = null, $uploaderUserId = null, $uploaderUserGroupId = null,
680  $round = null, $reviewRoundId = null, $latestOnly = false, $rangeInfo = null) {
681 
682  // Sanitize parameters.
683  $latestOnly = (boolean)$latestOnly;
684  if (!is_null($rangeInfo)) assert(is_a($rangeInfo, 'DBResultRange'));
685 
686  // It's not possible to specify both reviewRoundId and round.
687  // Round will be deprecated in favour of reviewRoundId.
688  if ($reviewRoundId && $round) {
689  assert(false);
690  $round = null;
691  }
692 
693  // Retrieve the base query.
694  $sql = $this->baseQueryForFileSelection($latestOnly);
695 
696  // Add the revision round file join if a revision round
697  // filter was requested.
698  $submissionEntity = $this->getSubmissionEntityName();
699  if ($round || $reviewRoundId) {
700  $sql .= 'INNER JOIN review_round_files rrf
701  ON sf.'.$submissionEntity.'_id = rrf.'.$submissionEntity.'_id
702  AND sf.file_id = rrf.file_id ';
703  }
704 
705  // Filter the query.
706  list($filterClause, $params) = $this->_buildFileSelectionFilter(
707  $submissionId, $fileStage, $fileId, $revision,
708  $assocType, $assocId, $stageId, $uploaderUserId, $uploaderUserGroupId, $round, $reviewRoundId);
709 
710  // Did the user request all or only the latest revision?
711  if ($latestOnly) {
712  // Filter the latest revision of each file.
713  // NB: We have to do this in the SQL for paging to work
714  // correctly. We use a partial cartesian join here to
715  // maintain MySQL 3.23 backwards compatibility. This
716  // should be ok as we usually only have few revisions per
717  // file.
718  $sql .= 'LEFT JOIN '.$submissionEntity.'_files sf2 ON sf.file_id = sf2.file_id AND sf.revision < sf2.revision
719  WHERE sf2.revision IS NULL AND '.$filterClause;
720  } else {
721  $sql .= 'WHERE '.$filterClause;
722  }
723 
724  // Order the query.
725  $sql .= ' ORDER BY sf.'.$submissionEntity.'_id ASC, sf.file_stage ASC, sf.file_id ASC, sf.revision DESC';
726 
727  // Execute the query.
728  if ($rangeInfo) {
729  $result =& $this->retrieveRange($sql, $params, $rangeInfo);
730  } else {
731  $result =& $this->retrieve($sql, $params);
732  }
733 
734  // Build the result array.
735  $submissionFiles = array();
736  while (!$result->EOF) {
737  // Retrieve the next result row.
738  $row =& $result->GetRowAssoc(false);
739 
740  // Construct a combined id from file id and revision
741  // that uniquely identifies the file.
742  $idAndRevision = $row['monograph_file_id'].'-'.$row['monograph_revision'];
743 
744  // Check for duplicates.
745  assert(!isset($submissionFiles[$idAndRevision]));
746 
747  // Instantiate the file and add it to the
748  // result array with a unique key.
749  // N.B. The subclass implementation of fromRow receives just the $row
750  // but calls PKPSubmissionFileDAO::fromRow($row, $fileImplementation) as defined here.
751  $submissionFiles[$idAndRevision] =& $this->fromRow($row);
752 
753  // Move the query cursor to the next record.
754  $result->MoveNext();
755  }
756  $result->Close();
757  unset($result);
758 
759  return $submissionFiles;
760  }
761 
779  function _deleteInternally($submissionId = null, $fileStage = null, $fileId = null, $revision = null,
780  $assocType = null, $assocId = null, $stageId = null, $uploaderUserId = null, $uploaderUserGroupId = null,
781  $round = null, $latestOnly = false) {
782 
783  // Identify all matched files.
784  $deletedFiles =& $this->_getInternally($submissionId, $fileStage, $fileId, $revision,
785  $assocType, $assocId, $stageId, $uploaderUserId, $uploaderUserGroupId, $round, null, $latestOnly);
786  if (empty($deletedFiles)) return 0;
787 
788  $filterClause = '';
789  $conjunction = '';
790  $params = array();
791  foreach($deletedFiles as $deletedFile) { /* @var $deletedFile SubmissionFile */
792  // Delete file in the database.
793  // NB: We cannot safely bulk-delete because MySQL 3.23
794  // does not support multi-column IN-clauses. Same is true
795  // for multi-table access or subselects in the DELETE
796  // statement. And having a long (... AND ...) OR (...)
797  // clause could hit length limitations.
798  $daoDelegate =& $this->_getDaoDelegateForObject($deletedFile);
799  if (!$daoDelegate->deleteObject($deletedFile)) return false;
800  }
801 
802  // Return the number of deleted files.
803  return count($deletedFiles);
804  }
805 
823  function _buildFileSelectionFilter($submissionId, $fileStage,
824  $fileId, $revision, $assocType, $assocId, $stageId, $uploaderUserId, $uploaderUserGroupId, $round, $reviewRoundId) {
825 
826  // Make sure that at least one entity filter has been set.
827  assert((int)$submissionId || (int)$uploaderUserId || (int)$fileId || (int)$assocId);
828 
829  // Both, assoc type and id, must be set (or unset) together.
830  assert(((int)$assocType && (int)$assocId) || !((int)$assocType || (int)$assocId));
831 
832  // It's not possible to specify both reviewRoundId and round.
833  // Round will be deprecated in favour of reviewRoundId.
834  if ($reviewRoundId && $round) {
835  assert(false);
836  $round = null;
837  }
838 
839  // Collect the filtered columns and ids in
840  // an array for consistent handling.
841  $submissionEntity = $this->getSubmissionEntityName();
842  $filters = array(
843  'sf.'.$submissionEntity.'_id' => $submissionId,
844  'sf.file_stage' => $fileStage,
845  'sf.file_id' => $fileId,
846  'sf.revision' => $revision,
847  'sf.assoc_type' => $assocType,
848  'sf.assoc_id' => $assocId,
849  'sf.uploader_user_id' => $uploaderUserId,
850  'sf.user_group_id' => $uploaderUserGroupId,
851  'rrf.stage_id' => $stageId,
852  'rrf.round' => $round,
853  'rrf.review_round_id' => $reviewRoundId
854  );
855 
856  // Build and return a SQL where clause and a parameter
857  // array.
858  $filterClause = '';
859  $params = array();
860  $conjunction = '';
861  foreach($filters as $filteredColumn => $filteredId) {
862  if ($filteredId) {
863  $filterClause .= $conjunction.' '.$filteredColumn.' = ?';
864  $conjunction = ' AND';
865  $params[] = (int)$filteredId;
866  }
867  }
868  return array($filterClause, $params);
869  }
870 
883  function &_castToGenre(&$submissionFile) {
884  // Find the required target implementation.
885  $targetImplementation = strtolower_codesafe(
887  $submissionFile->getGenreId())
888  );
889 
890  // If the current implementation of the updated object
891  // differs from the target implementation then we'll
892  // have to cast the object.
893  if (!is_a($submissionFile, $targetImplementation)) {
894  // The updated file has to be upcast by manually
895  // instantiating the target object and copying data
896  // to the target.
897  $targetDaoDelegate =& $this->_getDaoDelegate($targetImplementation);
898  $targetFile =& $targetDaoDelegate->newDataObject();
899  $targetFile =& $submissionFile->upcastTo($targetFile);
900  unset($submissionFile);
901  $submissionFile =& $targetFile;
902  }
903 
904  return $submissionFile;
905  }
906 
913  function &_castToDatabase(&$submissionFile) {
914  $fileId = $submissionFile->getFileId();
915  $revision = $submissionFile->getRevision();
916  unset($submissionFile);
917  return $this->getRevision($fileId, $revision);
918  }
919 
926  function &_checkAndReturnRevision(&$revisions) {
927  assert(count($revisions) <= 1);
928  if (empty($revisions)) {
929  $nullVar = null;
930  return $nullVar;
931  } else {
932  $revision =& array_pop($revisions);
933  assert(is_a($revision, 'SubmissionFile'));
934  return $revision;
935  }
936  }
937 }
938 
939 ?>
deleteLatestRevisionById($fileId, $fileStage=null, $submissionId=null)
_buildFileSelectionFilter($submissionId, $fileStage, $fileId, $revision, $assocType, $assocId, $stageId, $uploaderUserId, $uploaderUserGroupId, $round, $reviewRoundId)
& getAllRevisions($fileId, $fileStage=null, $submissionId=null, $rangeInfo=null)
& retrieve($sql, $params=false, $callHooks=true)
Definition: DAO.inc.php:83
deleteAllRevisionsById($fileId, $fileStage=null, $submissionId=null)
deleteAllRevisionsByReviewRound($submissionId, $stageId, $reviewRoundId)
& _castToGenre(&$submissionFile)
& getLatestRevision($fileId, $fileStage=null, $submissionId=null)
& insertObject(&$submissionFile, $sourceFile, $isUpload=false)
& getLatestNewRevisionsByReviewRound($submissionId, $stageId, $round, $fileStage=null)
Abstract base class for retrieving and modifying SubmissionFile objects and their decendents (e...
& updateObject(&$updatedFile, $previousFileId=null, $previousRevision=null)
& getRevisionsByReviewRound($submissionId, $stageId, $round, $fileStage=null, $uploaderUserId=null, $uploaderUserGroupId=null)
& retrieveRange($sql, $params=false, $dbResultRange=null, $callHooks=true)
Definition: DAO.inc.php:176
Class defining basic operations for file management.
_deleteInternally($submissionId=null, $fileStage=null, $fileId=null, $revision=null, $assocType=null, $assocId=null, $stageId=null, $uploaderUserId=null, $uploaderUserGroupId=null, $round=null, $latestOnly=false)
& getAllRevisionsByAssocId($assocType, $assocId, $fileStage=null, $rangeInfo=null)
deleteAllRevisionsBySubmissionId($submissionId, $fileStage=null)
& _getDaoDelegate($fileImplementation)
transferOwnership($oldUserId, $newUserId)
deleteAllRevisionsByAssocId($assocType, $assocId, $fileStage=null)
& getDAO($name, $dbconn=null)
& _castToDatabase(&$submissionFile)
& fromRow(&$row, $fileImplementation)
deleteReviewRoundAssignment($submissionId, $stageId, $fileId, $revision)
& _getInternally($submissionId=null, $fileStage=null, $fileId=null, $revision=null, $assocType=null, $assocId=null, $stageId=null, $uploaderUserId=null, $uploaderUserGroupId=null, $round=null, $reviewRoundId=null, $latestOnly=false, $rangeInfo=null)
Abstract base class for retrieving and modifying PKPFile objects and their decendents.
& getLatestRevisions($submissionId, $fileStage=null, $rangeInfo=null)
deleteRevisionById($fileId, $revision, $fileStage=null, $submissionId=null)
update($sql, $params=false, $callHooks=true, $dieOnError=true)
Definition: DAO.inc.php:211
assignRevisionToReviewRound($fileId, $revision, $stageId, $reviewRoundId, $submissionId)
& getLatestRevisionsByAssocId($assocType, $assocId, $submissionId=null, $fileStage=null, $rangeInfo=null)
& setAsLatestRevision($revisedFileId, $newFileId, $submissionId, $fileStage)
& getRevision($fileId, $revision, $fileStage=null, $submissionId=null)