Instantiate the required library class
$http = new \Romby\Box\Http\Adapters\GuzzleHttpAdapter(new \GuzzleHttp\Client())
$groups = new \Romby\Box\Services\Groups($http);/* @param string $token the OAuth token.
* @return array the groups.
*/
$groups->all($token);/* @param string $token the OAuth token.
* @param string $name the name of the group.
* @return array the new group.
*/
$groups->create($token, $name);/* @param string $token the OAuth token.
* @param int $id the ID of the group.
* @param string $name the new name of the group.
* @return array the updated group.
*/
$groups->update($token, $id, $name);/* @param string $token the OAuth token.
* @param int $id the ID of the group.
* @return void
*/
$groups->delete($token, $id);/* @param string $token the OAuth token.
* @param int $id the ID of the group.
* @return array group membership entries.
*/
$groups->getMembershipList($token, $id);/* @param string $token the OAuth token.
* @param int $id the ID of the user.
* @return array group membership entries.
*/
$groups->getUsersGroups($token, $id);/* @param string $token the OAuth token.
* @param int $id the ID of the group membership entry.
* @return array the group membership entry.
*/
$groups->getMembershipEntry($token, $id);/* @param string $token the OAuth token.
* @param int $userId the ID of the user.
* @param int $groupId the ID of the group.
* @param string|null $role the role of the member.
* @return array group membership entry.
*/
$groups->addUserToGroup($token, $userId, $groupId, $role = null);/* @param string $token the OAuth token.
* @param int $id the ID of the membership entry.
* @param string $role the role of the user.
* @return array group membership entry.
*/
$groups->updateMembershipEntry($token, $id, $role);/* @param string $token the OAuth token.
* @param int $id the ID of the user.
* @return void.
*/
$groups->deleteMembershipEntry($token, $id);/* @param string $token the OAuth token.
* @param int $id the ID of the group.
* @return array collaborations.
*/
$groups->getAllCollaborations($token, $id);