code/VersionedFileExtension.php
public function createVersion()
    {
        if (!file_exists($this->owner->getFullPath())) {
            return false;
        }

        $version = new FileVersion();
        $version->FileID = $this->owner->ID;
        $version->write();

        $this->owner->CurrentVersionID = $version->ID;
        return (bool) $this->owner->write();
    }
public function createVersion()
    {
        if (!file_exists($this->owner->getFullPath())) {
            return false;
        }

        $version = new FileVersion();
        $version->FileID = $this->owner->ID;
        $version->write();

        $this->owner->CurrentVersionID = $version->ID;
        return (bool) $this->owner->write();
    }
public function createVersion ( ) { if ( ! file_exists ( $ this -> owner -> getFullPath ( ) ) ) { return false ; } $ version = new FileVersion ( ) ; $ version -> FileID = $ this -> owner -> ID ; $ version -> write ( ) ; $ this -> owner -> CurrentVersionID = $ version -> ID ; return ( bool ) $ this -> owner -> write ( ) ; }
Creates a new file version and sets it as the current version.

@return boolean Whether file version is created
Creates a new file version and sets it as the current version .