src/Api/User.php
public function communities() : array
    {
        $returnCommunities = [];

        $communities = $this->get(Community::COMMUNITY_ENDPOINT . 'communities', [
            'fields' => 'backgroundImage,description,id,isCommon,members,name,profileImage,role,unreadMessageCount,sessions,timezoneUtcOffset,language,titleName',
            'includeFields' => 'gameSessions,timezoneUtcOffset,parties',
            'sort' => 'common',
            'onlineId' => $this->onlineId()
        ]);

        if ($communities->size === 0) return $returnCommunities;
        
        foreach ($communities->communities as $community) {
            $returnCommunities[] = new Community($this->client, $community->id);
        }
        
        return $returnCommunities;

    }
public function communities() : array
    {
        $returnCommunities = [];

        $communities = $this->get(Community::COMMUNITY_ENDPOINT . 'communities', [
            'fields' => 'backgroundImage,description,id,isCommon,members,name,profileImage,role,unreadMessageCount,sessions,timezoneUtcOffset,language,titleName',
            'includeFields' => 'gameSessions,timezoneUtcOffset,parties',
            'sort' => 'common',
            'onlineId' => $this->onlineId()
        ]);

        if ($communities->size === 0) return $returnCommunities;
        
        foreach ($communities->communities as $community) {
            $returnCommunities[] = new Community($this->client, $community->id);
        }
        
        return $returnCommunities;

    }
public function communities ( ) : array { $ returnCommunities = [ ] ; $ communities = $ this -> get ( Community :: COMMUNITY_ENDPOINT . 'communities' , [ 'fields' => 'backgroundImage,description,id,isCommon,members,name,profileImage,role,unreadMessageCount,sessions,timezoneUtcOffset,language,titleName' , 'includeFields' => 'gameSessions,timezoneUtcOffset,parties' , 'sort' => 'common' , 'onlineId' => $ this -> onlineId ( ) ] ) ; if ( $ communities -> size === 0 ) return $ returnCommunities ; foreach ( $ communities -> communities as $ community ) { $ returnCommunities [ ] = new Community ( $ this -> client , $ community -> id ) ; } return $ returnCommunities ; }
Get all Communities the User is in.

@return array Array of Api\Community.
Get all Communities the User is in .