/** * Method to get the database connection. * * If detected that the code is being run in a super group * component, it will return the super group DB connection * instead of the site connection. * * @return object Database */ public function initDbo() { if (defined('JPATH_GROUPCOMPONENT')) { $r = new \ReflectionClass($this); if (substr($r->getFileName(), 0, strlen(JPATH_GROUPCOMPONENT)) == JPATH_GROUPCOMPONENT) { return \Hubzero\User\Group\Helper::getDbo(); } } return \App::get('db'); }