<?php
class DBVersionHelper {

    public $version;
    static private $instance = NULL;

    static public function getInstance() {
        
        if (self::$instance == NULL) {
            self::$instance = new DBVersionHelper;
        }
        return self::$instance;
    }

    private function __construct() {
        $currentVasion = DatabaseVersion::model()->find(array(),'version DESC',1,0);
        if (is_array($currentVasion) && count($currentVasion)) {
            $this->version = $currentVasion[0];
        }
    }

}
?>