class GroupsService

Service used to do all kinds of stuff with groups and teams.

Properties

protected CacheBackendInterface $cacheBackend

The cache backend.

protected Connection $connection

The database connection.

protected AccountInterface $currentUser

The current user.

protected string $getTeamsEndpoint

The default endpoint for getting a list of teams.

protected GraphService $o365Graph

The o365.graph service.

protected array $teams

List of all teams.

Methods

__construct(GraphService $o365_graph, CacheBackendInterface $cacheBackend, AccountProxyInterface $accountProxy, Connection $connection)

Constructs a GroupsService object.

bool|string
generateTeamChannelLink(int $gid)

Generate a link to a team channel based on the ID.

array
getGroupsFromTeams()

Get all the available groups from teams.

void
getTeamsFromGraph(bool|string $endpoint = FALSE)

Get a list of all groups in Microsoft 365.

mixed
getTeamsUuidForGroup(int $gid, bool $onlyUuid = FALSE)

Get the saved teams UUID from the database, or FALSE.

void
saveTeamsUuidForGroup(string $uuid, int $gid)

Save the teams UUID in the database.

Details

at line 72
__construct(GraphService $o365_graph, CacheBackendInterface $cacheBackend, AccountProxyInterface $accountProxy, Connection $connection)

Constructs a GroupsService object.

Parameters

GraphService $o365_graph

The o365.graph service.

CacheBackendInterface $cacheBackend

The cache backend.

AccountProxyInterface $accountProxy

The account proxy.

Connection $connection

The database connection.

Generate a link to a team channel based on the ID.

Parameters

int $gid

The group ID.

Return Value

bool|string

The URL to the team or FALSE.

Exceptions

TempStoreException
GuzzleException
IdentityProviderException

at line 89
array getGroupsFromTeams()

Get all the available groups from teams.

Return Value

array

The list of available teams.

Exceptions

TempStoreException
GuzzleException
IdentityProviderException

at line 112
protected void getTeamsFromGraph(bool|string $endpoint = FALSE)

Get a list of all groups in Microsoft 365.

Parameters

bool|string $endpoint

The endpoint string containing the skipToken or FALSE for default.

Return Value

void

Exceptions

TempStoreException
GuzzleException
IdentityProviderException

at line 200
mixed getTeamsUuidForGroup(int $gid, bool $onlyUuid = FALSE)

Get the saved teams UUID from the database, or FALSE.

Parameters

int $gid

The group ID.

bool $onlyUuid

If we only want to return the UUID.

Return Value

mixed

The data from the database or FALSE.

at line 225
void saveTeamsUuidForGroup(string $uuid, int $gid)

Save the teams UUID in the database.

Parameters

string $uuid

The teams UUID.

int $gid

The group ID.

Return Value

void

Exceptions

Exception