function getByBestId($fileId, $submissionId)
{
$file = null;
if ($fileId != '') {
$file = $this->getByPubId('publisher-id', $fileId, $submissionId);
}
if (!isset($file)) {
list($fileId, $revision) = array_map(create_function('$a', 'return (int) $a;'), preg_split('/-/', $fileId));
$file = $this->getRevision($fileId, $revision, null, $submissionId);
}
if ($file && $file->getFileStage() == SUBMISSION_FILE_PROOF) {
return $file;
}
if ($file && $file->getFileStage() == SUBMISSION_FILE_DEPENDENT) {
return $file;
}
return null;
}