PHP 클래스 PKPSubmissionFileDAO, pkp-lib

상속: extends PKPFileDAO
파일 보기 프로젝트 열기: pkp/pkp-lib 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$_delegates a private list of delegates that provide operations for different SubmissionFile implementations.

공개 메소드들

메소드 설명
__construct ( ) Constructor
assignRevisionToReviewRound ( $fileId, $revision, $reviewRound ) Assign file to a review round.
baseQueryForFileSelection ( ) : string Return the basic join over all file class tables.
changePubId ( $fileId, $pubIdType, $pubId )
deleteAllPubIds ( $contextId, $pubIdType )
deleteAllRevisionsByAssocId ( $assocType, $assocId, $fileStage = null ) : integer Retrieve all files associated to a certain object.
deleteAllRevisionsById ( $fileId, $fileStage = null, $submissionId = null ) : integer Delete all revisions of a file, optionally restricted to a given file stage.
deleteAllRevisionsByReviewRound ( $reviewRoundId ) Remove all file assignements for the given review round.
deleteAllRevisionsBySubmissionId ( $submissionId, $fileStage = null ) : integer Delete all revisions of all files of a submission, optionally restricted to a given file stage.
deleteLatestRevisionById ( $fileId, $fileStage = null, $submissionId = null ) : integer Delete the latest revision of a submission file by id.
deletePubId ( $fileId, $pubIdType )
deleteReviewRoundAssignment ( $submissionId, $stageId, $fileId, $revision ) Remove a specific file assignment from a review round.
deleteRevision ( $submissionFile ) : integer Delete a specific revision of a submission file.
deleteRevisionById ( $fileId, $revision, $fileStage = null, $submissionId = null ) : integer Delete a specific revision of a submission file by id.
fromRow ( $row, $fileImplementation ) : SubmissionFile Internal function to return a SubmissionFile object from a row.
getAllFileStages ( ) : array Return all file stages.
getAllRevisions ( $fileId, $fileStage = null, $submissionId = null, $rangeInfo = null ) : array | null Retrieve all revisions of a submission file.
getAllRevisionsByAssocId ( $assocType, $assocId, $fileStage = null, $rangeInfo = null ) : array | null Retrieve all files associated to a certain object.
getByBestId ( $fileId, $submissionId ) : SubmissionFile | null Retrieve file by public ID or, failing that, internal file ID and revision; public ID takes precedence.
getByPubId ( $pubIdType, $pubId, $submissionId = null, $contextId = null ) : SubmissionFile | null Retrieve file by public file ID
getBySubmissionId ( $submissionId, $rangeInfo = null ) : array Retrieve all submission files & revisions for a submission.
getDelegateClassNames ( ) : array Return the available delegates mapped by lower case class names.
getFileIdsBySetting ( $settingName, $settingValue, $submissionId = null, $contextId = null ) : array Find file IDs by querying file settings.
getGenreCategoryMapping ( ) : array Return the mapping of genre categories to the lower case class name of file implementation.
getLatestRevision ( $fileId, $fileStage = null, $submissionId = null ) : SubmissionFile | null Retrieve the latest revision of a file.
getLatestRevisionNumber ( $fileId ) : integer | null Retrieve the current revision number for a file.
getLatestRevisions ( $submissionId, $fileStage = null, $rangeInfo = null ) : array | null Retrieve a list of current revisions.
getLatestRevisionsByAssocId ( $assocType, $assocId, $submissionId = null, $fileStage = null, $rangeInfo = null ) : array | null Retrieve the latest revision of all files associated to a certain object.
getLatestRevisionsByReviewRound ( $reviewRound, $fileStage = null ) : array Get the latest revisions of all files that are in the specified review round.
getRevision ( $fileId, $revision, $fileStage = null, $submissionId = null ) : SubmissionFile | null Retrieve a specific revision of a file.
getRevisionsByReviewRound ( $reviewRound, $fileStage = null, $uploaderUserId = null, $uploaderUserGroupId = null ) : array | null Get all file revisions assigned to the given review round.
insertObject ( $submissionFile, $sourceFile, $isUpload = false ) : SubmissionFile Insert a new SubmissionFile.
newDataObjectByGenreId ( $genreId ) : SubmissionFile Construct a new data object corresponding to this DAO.
pubIdExists ( $pubIdType, $pubId, $fileId, $contextId )
setAsLatestRevision ( $revisedFileId, $newFileId, $submissionId, $fileStage ) : SubmissionFile Set the latest revision of a file as the latest revision of another file.
transferOwnership ( $oldUserId, $newUserId ) Transfer the ownership of the submission files of one user to another.
updateObject ( $updatedFile, $previousFileId = null, $previousRevision = null ) : SubmissionFile Update an existing submission file.

비공개 메소드들

메소드 설명
_buildFileSelectionFilter ( $submissionId, $fileStage, $fileId, $revision, $assocType, $assocId, $stageId, $uploaderUserId, $uploaderUserGroupId, $reviewRoundId ) : array Build an SQL where clause to select submissions based on the given filter information.
_castToDatabase ( $submissionFile ) : SubmissionFile Make sure that a file's implementation corresponds to the way it is saved in the database.
_castToGenre ( $submissionFile ) : SubmissionFile Make sure that the genre of the file and its file implementation are compatible.
_checkAndReturnRevision ( $revisions ) : SubmissionFile Check whether the given array contains exactly zero or one revisions and return it.
_deleteInternally ( $submissionId = null, $fileStage = null, $fileId = null, $revision = null, $assocType = null, $assocId = null, $stageId = null, $uploaderUserId = null, $uploaderUserGroupId = null, $latestOnly = false ) : boolean | integer Private method to delete submission file revisions according to the given filters.
_getDaoDelegate ( $fileImplementation ) : SubmissionFileDAODelegate Return the requested SubmissionFileDAODelegate.
_getDaoDelegateForGenreId ( $genreId ) : SubmissionFileDAODelegate Instantiates an approprate SubmissionFileDAODelegate based on the given genre identifier.
_getDaoDelegateForObject ( $object ) : SubmissionFileDAODelegate Instantiates an appropriate SubmissionFileDAODelegate based on the given SubmissionFile.
_getFileImplementationForGenreId ( $genreId ) : string Map a genre to the corresponding file implementation.
_getInternally ( $submissionId = null, $fileStage = null, $fileId = null, $revision = null, $assocType = null, $assocId = null, $stageId = null, $uploaderUserId = null, $uploaderUserGroupId = null, $reviewRoundId = null, $latestOnly = false, $rangeInfo = null ) : array Private method to retrieve submission file revisions according to the given filters.

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( )

assignRevisionToReviewRound() 공개 메소드

Assign file to a review round.
public assignRevisionToReviewRound ( $fileId, $revision, $reviewRound )
$fileId int The file to be assigned.
$revision int The revision of the file to be assigned.
$reviewRound ReviewRound

baseQueryForFileSelection() 공개 메소드

Return the basic join over all file class tables.

changePubId() 공개 메소드

public changePubId ( $fileId, $pubIdType, $pubId )

deleteAllPubIds() 공개 메소드

public deleteAllPubIds ( $contextId, $pubIdType )

deleteAllRevisionsByAssocId() 공개 메소드

Retrieve all files associated to a certain object.
public deleteAllRevisionsByAssocId ( $assocType, $assocId, $fileStage = null ) : integer
$assocType int ASSOC_TYPE_...
$assocId int ID corresponding to specified assocType.
$fileStage int (optional) further restricts the selection to a given file stage.
리턴 integer the number of deleted file revisions.

deleteAllRevisionsById() 공개 메소드

Delete all revisions of a file, optionally restricted to a given file stage.
public deleteAllRevisionsById ( $fileId, $fileStage = null, $submissionId = null ) : integer
$fileId int File ID.
$fileStage int (optional) further restricts the selection to a given file stage.
$submissionId int (optional) for validation purposes only
리턴 integer the number of deleted file revisions

deleteAllRevisionsByReviewRound() 공개 메소드

Remove all file assignements for the given review round.
public deleteAllRevisionsByReviewRound ( $reviewRoundId )
$reviewRoundId int The review round ID.

deleteAllRevisionsBySubmissionId() 공개 메소드

Delete all revisions of all files of a submission, optionally restricted to a given file stage.
public deleteAllRevisionsBySubmissionId ( $submissionId, $fileStage = null ) : integer
$submissionId int Submission ID.
$fileStage int (optional) further restricts the selection to a given file stage.
리턴 integer the number of deleted file revisions

deleteLatestRevisionById() 공개 메소드

Delete the latest revision of a submission file by id.
public deleteLatestRevisionById ( $fileId, $fileStage = null, $submissionId = null ) : integer
$fileId int File ID.
$fileStage int (optional) further restricts the selection to a given file stage.
$submissionId int (optional) for validation purposes only
리턴 integer the number of deleted file revisions

deletePubId() 공개 메소드

public deletePubId ( $fileId, $pubIdType )

deleteReviewRoundAssignment() 공개 메소드

Remove a specific file assignment from a review round.
public deleteReviewRoundAssignment ( $submissionId, $stageId, $fileId, $revision )
$submissionId int The submission id of the file
$stageId int The review round type.
$fileId int The file id.
$revision int The file revision.

deleteRevision() 공개 메소드

Delete a specific revision of a submission file.
public deleteRevision ( $submissionFile ) : integer
$submissionFile SubmissionFile
리턴 integer the number of deleted file revisions

deleteRevisionById() 공개 메소드

Delete a specific revision of a submission file by id.
public deleteRevisionById ( $fileId, $revision, $fileStage = null, $submissionId = null ) : integer
$fileId int File ID.
$revision int File revision number.
$fileStage int (optional) further restricts the selection to a given file stage.
$submissionId int (optional) for validation purposes only
리턴 integer the number of deleted file revisions

fromRow() 공개 메소드

Internal function to return a SubmissionFile object from a row.
public fromRow ( $row, $fileImplementation ) : SubmissionFile
$row array
$fileImplementation string
리턴 SubmissionFile

getAllFileStages() 공개 메소드

Return all file stages.
public getAllFileStages ( ) : array
리턴 array

getAllRevisions() 공개 메소드

Retrieve all revisions of a submission file.
public getAllRevisions ( $fileId, $fileStage = null, $submissionId = null, $rangeInfo = null ) : array | null
$fileId int File ID.
$fileStage int (optional) further restricts the selection to a given file stage.
$submissionId int Optional submission ID for validation purposes only
$rangeInfo DBResultRange (optional)
리턴 array | null a list of SubmissionFile instances

getAllRevisionsByAssocId() 공개 메소드

Retrieve all files associated to a certain object.
public getAllRevisionsByAssocId ( $assocType, $assocId, $fileStage = null, $rangeInfo = null ) : array | null
$assocType int ASSOC_TYPE_...
$assocId int ID corresponding to specified assocType.
$fileStage int (optional) further restricts the selection to a given file stage.
$rangeInfo DBResultRange (optional)
리턴 array | null a list of SubmissionFile instances

getByBestId() 공개 메소드

Retrieve file by public ID or, failing that, internal file ID and revision; public ID takes precedence.
public getByBestId ( $fileId, $submissionId ) : SubmissionFile | null
$fileId string Either public ID or fileId-revision
$submissionId int
리턴 SubmissionFile | null

getByPubId() 공개 메소드

Retrieve file by public file ID
public getByPubId ( $pubIdType, $pubId, $submissionId = null, $contextId = null ) : SubmissionFile | null
$pubIdType string One of the NLM pub-id-type values or 'other::something' if not part of the official NLM list (see ).
$pubId string
$submissionId int optional
$contextId int optional
리턴 SubmissionFile | null

getBySubmissionId() 공개 메소드

Retrieve all submission files & revisions for a submission.
public getBySubmissionId ( $submissionId, $rangeInfo = null ) : array
$submissionId int Submission ID.
$rangeInfo DBResultRange (optional)
리턴 array a list of SubmissionFile instances

getDelegateClassNames() 공개 메소드

Return the available delegates mapped by lower case class names.
public getDelegateClassNames ( ) : array
리턴 array a list of fully qualified class names indexed by the lower case class name of the file implementation they serve. NB: Be careful to order class names such that they can be called in the given order to delete files without offending foreign key constraints, i.e. place the sub-classes before the super-classes.

getFileIdsBySetting() 공개 메소드

Find file IDs by querying file settings.
public getFileIdsBySetting ( $settingName, $settingValue, $submissionId = null, $contextId = null ) : array
$settingName string
$settingValue mixed
$submissionId int optional
$contextId int optional
리턴 array The file IDs identified by setting.

getGenreCategoryMapping() 공개 메소드

Return the mapping of genre categories to the lower case class name of file implementation.
public getGenreCategoryMapping ( ) : array
리턴 array a list of lower case class names of file implementations.

getLatestRevision() 공개 메소드

Retrieve the latest revision of a file.
public getLatestRevision ( $fileId, $fileStage = null, $submissionId = null ) : SubmissionFile | null
$fileId int File ID.
$fileStage int (optional) further restricts the selection to a given file stage.
$submissionId int (optional) for validation purposes only
리턴 SubmissionFile | null

getLatestRevisionNumber() 공개 메소드

Retrieve the current revision number for a file.
public getLatestRevisionNumber ( $fileId ) : integer | null
$fileId int File ID.
리턴 integer | null

getLatestRevisions() 공개 메소드

Retrieve a list of current revisions.
public getLatestRevisions ( $submissionId, $fileStage = null, $rangeInfo = null ) : array | null
$submissionId int Submission ID.
$fileStage int (optional) further restricts the selection to a given file stage.
$rangeInfo DBResultRange (optional)
리턴 array | null a list of SubmissionFile instances

getLatestRevisionsByAssocId() 공개 메소드

Retrieve the latest revision of all files associated to a certain object.
public getLatestRevisionsByAssocId ( $assocType, $assocId, $submissionId = null, $fileStage = null, $rangeInfo = null ) : array | null
$assocType int ASSOC_TYPE_...
$assocId int ID corresponding to specified assocType.
$fileStage int (optional) further restricts the selection to a given file stage.
$rangeInfo DBResultRange (optional)
리턴 array | null a list of SubmissionFile instances

getLatestRevisionsByReviewRound() 공개 메소드

Get the latest revisions of all files that are in the specified review round.
public getLatestRevisionsByReviewRound ( $reviewRound, $fileStage = null ) : array
$reviewRound ReviewRound
$fileStage int SUBMISSION_FILE_... (Optional)
리턴 array A list of SubmissionFiles.

getRevision() 공개 메소드

Retrieve a specific revision of a file.
public getRevision ( $fileId, $revision, $fileStage = null, $submissionId = null ) : SubmissionFile | null
$fileId int File ID.
$revision int File revision number.
$fileStage int (optional) further restricts the selection to a given file stage.
$submissionId int|null (optional) for validation purposes only
리턴 SubmissionFile | null

getRevisionsByReviewRound() 공개 메소드

Get all file revisions assigned to the given review round.
public getRevisionsByReviewRound ( $reviewRound, $fileStage = null, $uploaderUserId = null, $uploaderUserGroupId = null ) : array | null
$reviewRound ReviewRound
$fileStage int SUBMISSION_FILE_...
$uploaderUserId int Uploader's user ID
$uploaderUserGroupId int Uploader's user group ID
리턴 array | null A list of SubmissionFiles.

insertObject() 공개 메소드

Insert a new SubmissionFile.
public insertObject ( $submissionFile, $sourceFile, $isUpload = false ) : SubmissionFile
$submissionFile SubmissionFile
$sourceFile string The place where the physical file resides right now or the file name in the case of an upload. The file will be copied to its canonical target location.
$isUpload boolean set to true if the file has just been uploaded.
리턴 SubmissionFile

newDataObjectByGenreId() 공개 메소드

Construct a new data object corresponding to this DAO.
public newDataObjectByGenreId ( $genreId ) : SubmissionFile
$genreId integer The genre is required to identify the right file implementation.
리턴 SubmissionFile

pubIdExists() 공개 메소드

public pubIdExists ( $pubIdType, $pubId, $fileId, $contextId )

setAsLatestRevision() 공개 메소드

Set the latest revision of a file as the latest revision of another file.
public setAsLatestRevision ( $revisedFileId, $newFileId, $submissionId, $fileStage ) : SubmissionFile
$revisedFileId integer the revised file
$newFileId integer the file that will become the latest revision of the revised file.
$submissionId integer the submission id the two files must belong to.
$fileStage integer the file stage the two files must belong to.
리턴 SubmissionFile the new revision or null if something went wrong.

transferOwnership() 공개 메소드

Transfer the ownership of the submission files of one user to another.
public transferOwnership ( $oldUserId, $newUserId )
$oldUserId int User ID of old user (to be deleted)
$newUserId int User ID of new user (to receive assets belonging to old user)

updateObject() 공개 메소드

NB: We implement a delete + insert strategy to deal with various casting problems (e.g. file implementation/genre may change, file path may change, etc.).
public updateObject ( $updatedFile, $previousFileId = null, $previousRevision = null ) : SubmissionFile
$updatedFile SubmissionFile
$previousFileId integer The file id before the file was changed. Must only be given if the file id changed so that the previous file can be identified.
$previousRevision integer The revision before the file was changed. Must only be given if the revision changed so that the previous file can be identified.
리턴 SubmissionFile The updated file. This file may be of a different file implementation than the file passed into the method if the genre of the file didn't fit its implementation.

프로퍼티 상세

$_delegates 공개적으로 프로퍼티

a private list of delegates that provide operations for different SubmissionFile implementations.
public $_delegates