src/Versioned.php
public function getAtVersion($from)
    {
        // Null implies return current version
        if (is_null($from)) {
            return $this->owner;
        }

        $baseClass = $this->owner->baseClass();
        $id = $this->owner->ID ?: $this->owner->OldID;

        // By version number
        if (is_numeric($from)) {
            return Versioned::get_version($baseClass, $id, $from);
        }

        // By stage
        return Versioned::get_by_stage($baseClass, $from)->byID($id);
    }
public function getAtVersion($from)
    {
        // Null implies return current version
        if (is_null($from)) {
            return $this->owner;
        }

        $baseClass = $this->owner->baseClass();
        $id = $this->owner->ID ?: $this->owner->OldID;

        // By version number
        if (is_numeric($from)) {
            return Versioned::get_version($baseClass, $id, $from);
        }

        // By stage
        return Versioned::get_by_stage($baseClass, $from)->byID($id);
    }
public function getAtVersion ( $ from ) { // Null implies return current version if ( is_null ( $ from ) ) { return $ this -> owner ; } $ baseClass = $ this -> owner -> baseClass ( ) ; $ id = $ this -> owner -> ID ? : $ this -> owner -> OldID ; // By version number if ( is_numeric ( $ from ) ) { return Versioned :: get_version ( $ baseClass , $ id , $ from ) ; } // By stage return Versioned :: get_by_stage ( $ baseClass , $ from ) -> byID ( $ id ) ; }
Get this record at a specific version

@param int|string|null $from Version or stage to get at. Null mean returns self object
@return Versioned|DataObject
Get this record at a specific version