original_string: 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();
      }
code: 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();
      }
code_tokens: 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 ( ) ; }
docstring: Load database connection
docstring_tokens: Load database connection