public static function getDbo($config = array(), $cname = '')
	{
		// empty instance of db
		$db = App::get('db');

		// make sure we have a group object
		if (!$group = Group::getInstance(\Request::getString('cn', $cname)))
		{
			return $db;
		}

		// make sure we are a super group
		if (!$group->isSuperGroup())
		{
			return $db;
		}

		// load super group db config if not passed in
		if (empty($config))
		{
			// build path to config file
			$uploadPath = \Component::params( 'com_groups' )->get('uploadpath');
			$configPath = PATH_APP . DS . trim($uploadPath, DS) . DS . $group->get('gidNumber') . DS . 'config' . DS . 'db.php';

			// make sure file exists
			if (!file_exists($configPath))
			{
				return $db;
			}

			// include config
			$config = include $configPath;
		}

		// return instance of db
		return \Hubzero\Database\Driver::getInstance($config);
	}
public static function getDbo($config = array(), $cname = '')
	{
		// empty instance of db
		$db = App::get('db');

		// make sure we have a group object
		if (!$group = Group::getInstance(\Request::getString('cn', $cname)))
		{
			return $db;
		}

		// make sure we are a super group
		if (!$group->isSuperGroup())
		{
			return $db;
		}

		// load super group db config if not passed in
		if (empty($config))
		{
			// build path to config file
			$uploadPath = \Component::params( 'com_groups' )->get('uploadpath');
			$configPath = PATH_APP . DS . trim($uploadPath, DS) . DS . $group->get('gidNumber') . DS . 'config' . DS . 'db.php';

			// make sure file exists
			if (!file_exists($configPath))
			{
				return $db;
			}

			// include config
			$config = include $configPath;
		}

		// return instance of db
		return \Hubzero\Database\Driver::getInstance($config);
	}
public static function getDbo ( $ config = array ( ) , $ cname = '' ) { // empty instance of db $ db = App :: get ( 'db' ) ; // make sure we have a group object if ( ! $ group = Group :: getInstance ( \ Request :: getString ( 'cn' , $ cname ) ) ) { return $ db ; } // make sure we are a super group if ( ! $ group -> isSuperGroup ( ) ) { return $ db ; } // load super group db config if not passed in if ( empty ( $ config ) ) { // build path to config file $ uploadPath = \ Component :: params ( 'com_groups' ) -> get ( 'uploadpath' ) ; $ configPath = PATH_APP . DS . trim ( $ uploadPath , DS ) . DS . $ group -> get ( 'gidNumber' ) . DS . 'config' . DS . 'db.php' ; // make sure file exists if ( ! file_exists ( $ configPath ) ) { return $ db ; } // include config $ config = include $ configPath ; } // return instance of db return \ Hubzero \ Database \ Driver :: getInstance ( $ config ) ; }
Get Instance of Super Group Database

Always returns the same instance whenever this method is called

@param   array   $config  Array of database options
@param   string  $cname
@return  object  Database Object
Get Instance of Super Group Database