concrete/src/Entity/File/File.php
public function createNewVersion($copyUnderlyingFile = false)
    {
        $fv = $this->getRecentVersion();
        $fav = $this->getApprovedVersion();
        $fv2 = $fv->duplicate();

        if ($fv->getFileVersionID() == $fav->getFileVersionID()) {
            $fv2->approve();
        }

        if ($copyUnderlyingFile) {
            $fv2->duplicateUnderlyingFile();
        }

        return $fv2;
    }
public function createNewVersion($copyUnderlyingFile = false)
    {
        $fv = $this->getRecentVersion();
        $fav = $this->getApprovedVersion();
        $fv2 = $fv->duplicate();

        if ($fv->getFileVersionID() == $fav->getFileVersionID()) {
            $fv2->approve();
        }

        if ($copyUnderlyingFile) {
            $fv2->duplicateUnderlyingFile();
        }

        return $fv2;
    }
public function createNewVersion ( $ copyUnderlyingFile = false ) { $ fv = $ this -> getRecentVersion ( ) ; $ fav = $ this -> getApprovedVersion ( ) ; $ fv2 = $ fv -> duplicate ( ) ; if ( $ fv -> getFileVersionID ( ) == $ fav -> getFileVersionID ( ) ) { $ fv2 -> approve ( ) ; } if ( $ copyUnderlyingFile ) { $ fv2 -> duplicateUnderlyingFile ( ) ; } return $ fv2 ; }
Create a new version of a file.

@param bool $copyUnderlyingFile If we should copy the underlying file, or reference the original

@return Version
Create a new version of a file .