PKPSubmissionFileDAO::getByPubId PHP Method

getByPubId() public method

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
return SubmissionFile | null
    function getByPubId($pubIdType, $pubId, $submissionId = null, $contextId = null)
    {
        $file = null;
        if (!empty($pubId)) {
            $fileIds = $this->getFileIdsBySetting('pub-id::' . $pubIdType, $pubId, $submissionId, $contextId);
            if (!empty($fileIds)) {
                assert(count($fileIds) == 1);
                $fileId = $fileIds[0];
                $file = $this->getLatestRevision($fileId, SUBMISSION_FILE_PROOF, $submissionId);
            }
        }
        return $file;
    }