public function getAllGroups ()
    {
        $request = new Request("GET", "https://api.weixin.qq.com/cgi-bin/groups/get");
        $response = $this->client->send($request);
        $json = json_decode($response->getBody());
        $groups = [];

        if (isset($json->groups)) {
            foreach ($json->groups as $group) {
                $groups[] = new Group($group->id, $group->name, $group->count);
            }
        } else {
            throw new Exception("bad response: expected property `groups`");
        }

        return $groups;
    }
public function getAllGroups ()
    {
        $request = new Request("GET", "https://api.weixin.qq.com/cgi-bin/groups/get");
        $response = $this->client->send($request);
        $json = json_decode($response->getBody());
        $groups = [];

        if (isset($json->groups)) {
            foreach ($json->groups as $group) {
                $groups[] = new Group($group->id, $group->name, $group->count);
            }
        } else {
            throw new Exception("bad response: expected property `groups`");
        }

        return $groups;
    }
public function getAllGroups ( ) { $ request = new Request ( "GET" , "https://api.weixin.qq.com/cgi-bin/groups/get" ) ; $ response = $ this -> client -> send ( $ request ) ; $ json = json_decode ( $ response -> getBody ( ) ) ; $ groups = [ ] ; if ( isset ( $ json -> groups ) ) { foreach ( $ json -> groups as $ group ) { $ groups [ ] = new Group ( $ group -> id , $ group -> name , $ group -> count ) ; } } else { throw new Exception ( "bad response: expected property `groups`" ) ; } return $ groups ; }
Retrieves a list of all the groups that have been created in this OA.

@return Group[]

@throws GuzzleException
@throws APIErrorException
Retrieves a list of all the groups that have been created in this OA .