PKPSubmissionFileDAO::getLatestRevisionNumber PHP Method

getLatestRevisionNumber() public method

Retrieve the current revision number for a file.
public getLatestRevisionNumber ( $fileId ) : integer | null
$fileId int File ID.
return integer | null
    function getLatestRevisionNumber($fileId)
    {
        assert(!is_null($fileId));
        // Retrieve the latest revision from the database.
        $result = $this->retrieve('SELECT MAX(revision) AS max_revision FROM submission_files WHERE file_id = ?', (int) $fileId);
        if ($result->RecordCount() != 1) {
            return null;
        }
        $row = $result->FetchRow();
        $result->Close();
        $latestRevision = (int) $row['max_revision'];
        assert($latestRevision > 0);
        return $latestRevision;
    }