src/Versioned.php
public static function get_version($class, $id, $version)
    {
        $baseClass = DataObject::getSchema()->baseDataClass($class);
        $list = DataList::create($baseClass)
            ->setDataQueryParam([
                "Versioned.mode" => 'version',
                "Versioned.version" => $version
            ]);

        return $list->byID($id);
    }
public static function get_version($class, $id, $version)
    {
        $baseClass = DataObject::getSchema()->baseDataClass($class);
        $list = DataList::create($baseClass)
            ->setDataQueryParam([
                "Versioned.mode" => 'version',
                "Versioned.version" => $version
            ]);

        return $list->byID($id);
    }
public static function get_version ( $ class , $ id , $ version ) { $ baseClass = DataObject :: getSchema ( ) -> baseDataClass ( $ class ) ; $ list = DataList :: create ( $ baseClass ) -> setDataQueryParam ( [ "Versioned.mode" => 'version' , "Versioned.version" => $ version ] ) ; return $ list -> byID ( $ id ) ; }
Return the specific version of the given id.

Caution: The record is retrieved as a DataObject, but saving back
modifications via write() will create a new version, rather than
modifying the existing one.

@param string $class
@param int $id
@param int $version

@return DataObject
Return the specific version of the given id .