setDBO(VoxelCareDB::getDatabase()); }//function function SetId($id) { $this->_id = (int)$id; $this->_item = null; } /* function store(&$data) { $table =& $this->getTable('usergroup'); $db =& $this->_db; $table->reset(); $id = (int)$data['id']; $table->load($id); if (!$table->bind($data)) return false; if (!$table->check()) return false; if (!$table->store(true)) return false; $this->SetId($table->id); $data['id'] = $this->_id; return true; } */ function getUsersByGroup($groupId) { $groupId = (int)$groupId; if (!$groupId) return null; $db =& $this->_db; $sql = "SELECT ug.id id, ug.user user FROM #__vxc_usergroup ug WHERE ug.group = ". $groupId; $db->setQuery($sql); return $db->loadObjectList(); } function getGroupsByUser($userId) { $userId = (int)$userId; if (!$userId) return null; $db =& $this->_db; $sql = "SELECT ug.id id, ug.user user FROM #__vxc_usergroup ug WHERE ug.user = ". $userId; $db->setQuery($sql); return $db->loadObjectList(); } }// class