src/Versioned.php
public static function get_one_by_stage($class, $stage, $filter = '', $cache = true, $sort = '')
    {
        return static::withVersionedMode(function () use ($class, $stage, $filter, $cache, $sort) {
            Versioned::set_stage($stage);
            return DataObject::get_one($class, $filter, $cache, $sort);
        });
    }
public static function get_one_by_stage($class, $stage, $filter = '', $cache = true, $sort = '')
    {
        return static::withVersionedMode(function () use ($class, $stage, $filter, $cache, $sort) {
            Versioned::set_stage($stage);
            return DataObject::get_one($class, $filter, $cache, $sort);
        });
    }
public static function get_one_by_stage ( $ class , $ stage , $ filter = '' , $ cache = true , $ sort = '' ) { return static :: withVersionedMode ( function ( ) use ( $ class , $ stage , $ filter , $ cache , $ sort ) { Versioned :: set_stage ( $ stage ) ; return DataObject :: get_one ( $ class , $ filter , $ cache , $ sort ) ; } ) ; }
Get a singleton instance of a class in the given stage.

@param string $class The name of the class.
@param string $stage The name of the stage.
@param string $filter A filter to be inserted into the WHERE clause.
@param boolean $cache Use caching.
@param string $sort A sort expression to be inserted into the ORDER BY clause.

@return DataObject
Get a singleton instance of a class in the given stage .