concrete/src/Page/Collection/Collection.php
public function cloneVersion($versionComments, $createEmpty = false)
    {
        $app = Application::getFacadeApplication();
        $cloner = $app->make(Cloner::class);
        $clonerOptions = $app->make(ClonerOptions::class)
            ->setVersionComments($versionComments)
            ->setCopyContents($createEmpty ? false : true)
        ;
        $newVersion = $cloner->cloneCollectionVersion($this->getVersionObject(), $this, $clonerOptions);

        return Page::getByID($newVersion->getCollectionID(), $newVersion->getVersionID());
    }
public function cloneVersion($versionComments, $createEmpty = false)
    {
        $app = Application::getFacadeApplication();
        $cloner = $app->make(Cloner::class);
        $clonerOptions = $app->make(ClonerOptions::class)
            ->setVersionComments($versionComments)
            ->setCopyContents($createEmpty ? false : true)
        ;
        $newVersion = $cloner->cloneCollectionVersion($this->getVersionObject(), $this, $clonerOptions);

        return Page::getByID($newVersion->getCollectionID(), $newVersion->getVersionID());
    }
public function cloneVersion ( $ versionComments , $ createEmpty = false ) { $ app = Application :: getFacadeApplication ( ) ; $ cloner = $ app -> make ( Cloner :: class ) ; $ clonerOptions = $ app -> make ( ClonerOptions :: class ) -> setVersionComments ( $ versionComments ) -> setCopyContents ( $ createEmpty ? false : true ) ; $ newVersion = $ cloner -> cloneCollectionVersion ( $ this -> getVersionObject ( ) , $ this , $ clonerOptions ) ; return Page :: getByID ( $ newVersion -> getCollectionID ( ) , $ newVersion -> getVersionID ( ) ) ; }
Clone the currently loaded version and returns a Page instance containing the new version.

@param string|null $versionComments the comments to be associated to the new Version
@param bool $createEmpty set to true to create a Version without any blocks/area styles, false to clone them too

@return \Concrete\Core\Page\Page
Clone the currently loaded version and returns a Page instance containing the new version .