private function _loadDatabase()
    {
        if (!isset(self::$db[$this->name])) {
            $config = Config::config()->{$this->name};
            if(!is_array($config))
                throw new \Exception ($config . ' not a valid db config');
            // Load database
            $db = new Database($config);

            self::$db[$this->name] = $db;
            self::$prefix = isset($config['prefix']) ? $config['prefix'] : '';
        }

        return $this->getDb();
    }
private function _loadDatabase()
    {
        if (!isset(self::$db[$this->name])) {
            $config = Config::config()->{$this->name};
            if(!is_array($config))
                throw new \Exception ($config . ' not a valid db config');
            // Load database
            $db = new Database($config);

            self::$db[$this->name] = $db;
            self::$prefix = isset($config['prefix']) ? $config['prefix'] : '';
        }

        return $this->getDb();
    }
private function _loadDatabase ( ) { if ( ! isset ( self :: $ db [ $ this -> name ] ) ) { $ config = Config :: config ( ) -> { $ this -> name } ; if ( ! is_array ( $ config ) ) throw new \ Exception ( $ config . ' not a valid db config' ) ; // Load database $ db = new Database ( $ config ) ; self :: $ db [ $ this -> name ] = $ db ; self :: $ prefix = isset ( $ config [ 'prefix' ] ) ? $ config [ 'prefix' ] : '' ; } return $ this -> getDb ( ) ; }
Load database connection
Load database connection