Nextcloud Circles API

CirclesManager
in package

Class CirclesManager

Table of Contents

$circleService  : CircleService
$circlesQueryHelper  : CirclesQueryHelper
$configService  : ConfigService
$federatedUserService  : FederatedUserService
$memberService  : MemberService
$membershipService  : MembershipService
__construct()  : mixed
CirclesManager constructor.
addMember()  : Member
createCircle()  : Circle
destroyCircle()  : void
flagAsAppManaged()  : void
getCircle()  : Circle
getCircles()  : array<string|int, Circle>
WARNING: This method is not using Cached Memberships meaning that the request can be heavy and should only be used if probeCircles() does not fit your need.
getCurrentFederatedUser()  : IFederatedUser
getDefinition()  : string
getFederatedUser()  : FederatedUser
getLink()  : Membership
getLocalFederatedUser()  : FederatedUser
getQueryHelper()  : CirclesQueryHelper
levelMember()  : Member
probeCircles()  : array<string|int, mixed>
Returns data about Circles based on cached Memberships.
removeMember()  : void
startAppSession()  : void
startOccSession()  : void
$userId - userId to emulate as initiator (can be empty) $userType - specify if userIs not a singleId $circleId - if no userId specified, will use the owner of the Circle as initiator
startSession()  : void
startSuperSession()  : void
stopSession()  : void
updateConfig()  : void

Properties

Methods

__construct()

CirclesManager constructor.

public __construct(FederatedUserService $federatedUserService, CircleService $circleService, MemberService $memberService, MembershipService $membershipService, ConfigService $configService, CirclesQueryHelper $circlesQueryHelper) : mixed
Parameters
$federatedUserService : FederatedUserService
$circleService : CircleService
$memberService : MemberService
$membershipService : MembershipService
$configService : ConfigService
$circlesQueryHelper : CirclesQueryHelper
Return values
mixed

addMember()

public addMember(string $circleId, FederatedUser $federatedUser) : Member
Parameters
$circleId : string
$federatedUser : FederatedUser
Tags
throws
CircleNotFoundException
throws
ContactAddressBookNotFoundException
throws
ContactFormatException
throws
ContactNotFoundException
throws
FederatedEventException
throws
FederatedItemException
throws
FederatedUserException
throws
InitiatorNotConfirmedException
throws
InitiatorNotFoundException
throws
InvalidIdException
throws
InvalidItemException
throws
OwnerNotFoundException
throws
RemoteInstanceException
throws
RemoteNotFoundException
throws
RemoteResourceNotFoundException
throws
RequestBuilderException
throws
SingleCircleNotFoundException
throws
UnknownRemoteException
Return values
Member

createCircle()

public createCircle(string $name[, FederatedUser|null $owner = null ][, bool $personal = false ][, bool $local = false ]) : Circle
Parameters
$name : string
$owner : FederatedUser|null = null
$personal : bool = false
$local : bool = false
Tags
throws
FederatedEventException
throws
InitiatorNotConfirmedException
throws
FederatedItemException
throws
InitiatorNotFoundException
throws
InvalidItemException
throws
OwnerNotFoundException
throws
RemoteInstanceException
throws
RemoteNotFoundException
throws
RemoteResourceNotFoundException
throws
RequestBuilderException
throws
UnknownRemoteException
Return values
Circle

destroyCircle()

public destroyCircle(string $singleId) : void
Parameters
$singleId : string
Tags
throws
CircleNotFoundException
throws
FederatedEventException
throws
FederatedItemException
throws
InitiatorNotConfirmedException
throws
InitiatorNotFoundException
throws
OwnerNotFoundException
throws
RemoteInstanceException
throws
RemoteNotFoundException
throws
RemoteResourceNotFoundException
throws
RequestBuilderException
throws
UnknownRemoteException
Return values
void

flagAsAppManaged()

public flagAsAppManaged(string $circleId[, bool $enabled = true ]) : void
Parameters
$circleId : string
$enabled : bool = true
Tags
throws
CircleNotFoundException
throws
FederatedEventException
throws
FederatedItemException
throws
FederatedUserException
throws
InitiatorNotConfirmedException
throws
InitiatorNotFoundException
throws
OwnerNotFoundException
throws
RemoteInstanceException
throws
RemoteNotFoundException
throws
RemoteResourceNotFoundException
throws
RequestBuilderException
throws
UnknownRemoteException
Return values
void

getCircles()

WARNING: This method is not using Cached Memberships meaning that the request can be heavy and should only be used if probeCircles() does not fit your need.

public getCircles([CircleProbe|null $probe = null ][, bool $refreshCache = false ]) : array<string|int, Circle>

Always prefer probeCircles();

returns available Circles to the current session.

Parameters
$probe : CircleProbe|null = null
$refreshCache : bool = false
Tags
see
probeCircles()
throws
InitiatorNotFoundException
throws
RequestBuilderException
Return values
array<string|int, Circle>

getFederatedUser()

public getFederatedUser(string $federatedId[, int $type = Member::TYPE_SINGLE ]) : FederatedUser
Parameters
$federatedId : string
$type : int = Member::TYPE_SINGLE
Tags
throws
CircleNotFoundException
throws
FederatedItemException
throws
FederatedUserException
throws
FederatedUserNotFoundException
throws
InvalidIdException
throws
MemberNotFoundException
throws
OwnerNotFoundException
throws
RemoteInstanceException
throws
RemoteNotFoundException
throws
RemoteResourceNotFoundException
throws
RequestBuilderException
throws
SingleCircleNotFoundException
throws
UnknownRemoteException
throws
UserTypeNotFoundException
Return values
FederatedUser

getLocalFederatedUser()

public getLocalFederatedUser(string $userId) : FederatedUser
Parameters
$userId : string
Tags
throws
CircleNotFoundException
throws
FederatedItemException
throws
FederatedUserException
throws
FederatedUserNotFoundException
throws
InvalidIdException
throws
MemberNotFoundException
throws
OwnerNotFoundException
throws
RemoteInstanceException
throws
RemoteNotFoundException
throws
RemoteResourceNotFoundException
throws
RequestBuilderException
throws
SingleCircleNotFoundException
throws
UnknownRemoteException
throws
UserTypeNotFoundException
Return values
FederatedUser

levelMember()

public levelMember(string $memberId, int $level) : Member
Parameters
$memberId : string
$level : int
Tags
throws
FederatedEventException
throws
FederatedItemException
throws
InitiatorNotConfirmedException
throws
InitiatorNotFoundException
throws
InvalidItemException
throws
MemberNotFoundException
throws
OwnerNotFoundException
throws
RemoteNotFoundException
throws
RemoteResourceNotFoundException
throws
RequestBuilderException
throws
UnknownRemoteException
Return values
Member

probeCircles()

Returns data about Circles based on cached Memberships.

public probeCircles([CircleProbe|null $circleProbe = null ][, DataProbe|null $dataProbe = null ]) : array<string|int, mixed>

Meaning that only Circles the current user is a member will be returned.

CircleProbe is used to filter Circles to be returned by the method. DataProbe is used to add details to returned Circles.

Parameters
$circleProbe : CircleProbe|null = null
$dataProbe : DataProbe|null = null
Tags
throws
InitiatorNotFoundException
throws
RequestBuilderException
Return values
array<string|int, mixed>

startOccSession()

$userId - userId to emulate as initiator (can be empty) $userType - specify if userIs not a singleId $circleId - if no userId specified, will use the owner of the Circle as initiator

public startOccSession(string $userId[, int $userType = Member::TYPE_SINGLE ][, string $circleId = '' ]) : void
Parameters
$userId : string
$userType : int = Member::TYPE_SINGLE
$circleId : string = ''
Tags
throws
CircleNotFoundException
throws
FederatedItemException
throws
FederatedUserException
throws
FederatedUserNotFoundException
throws
InvalidIdException
throws
MemberNotFoundException
throws
OwnerNotFoundException
throws
RemoteInstanceException
throws
RemoteNotFoundException
throws
RemoteResourceNotFoundException
throws
RequestBuilderException
throws
SingleCircleNotFoundException
throws
UnknownRemoteException
throws
UserTypeNotFoundException
Return values
void

startSuperSession()

public startSuperSession() : void
Return values
void

stopSession()

public stopSession() : void
Return values
void

Search results