function bp_docs_get_group_term($group_id)
{
    $group = groups_get_group(array('group_id' => intval($group_id)));
    $group_name = isset($group->name) ? $group->name : '';
    return bp_docs_get_item_term_id($group_id, 'group', $group_name);
}
 /**
  * Gets the id of the taxonomy term associated with the item
  *
  * @since 1.0-beta
  *
  * @return str $view The current item type
  */
 function setup_terms()
 {
     global $bp;
     $this->term_id = bp_docs_get_item_term_id($this->item_id, $this->item_type, $this->item_name);
     if (bp_is_user()) {
         // If this is a User Doc, then the user_term_id is the same as the term_id
         $this->user_term_id = $this->term_id;
     } else {
         $this->user_term_id = bp_docs_get_item_term_id($this->item_id, 'user', bp_get_loggedin_user_fullname());
     }
 }