original_string: public function get_all_groups($userid) {
          if (isset($this->usergroups[$userid])) {
              return $this->usergroups[$userid];
          }
  
          $grouping = $this->get_instance()->teamsubmissiongroupingid;
          $return = groups_get_all_groups($this->get_course()->id, $userid, $grouping);
  
          $this->usergroups[$userid] = $return;
  
          return $return;
      }
code: public function get_all_groups($userid) {
          if (isset($this->usergroups[$userid])) {
              return $this->usergroups[$userid];
          }
  
          $grouping = $this->get_instance()->teamsubmissiongroupingid;
          $return = groups_get_all_groups($this->get_course()->id, $userid, $grouping);
  
          $this->usergroups[$userid] = $return;
  
          return $return;
      }
code_tokens: public function get_all_groups ( $ userid ) { if ( isset ( $ this -> usergroups [ $ userid ] ) ) { return $ this -> usergroups [ $ userid ] ; } $ grouping = $ this -> get_instance ( ) -> teamsubmissiongroupingid ; $ return = groups_get_all_groups ( $ this -> get_course ( ) -> id , $ userid , $ grouping ) ; $ this -> usergroups [ $ userid ] = $ return ; return $ return ; }
docstring: Gets all groups the user is a member of.
  
  @param int $userid Teh id of the user who's groups we are checking
  @return array The group objects
docstring_tokens: Gets all groups the user is a member of .