Nextcloud Circles API

CircleService
in package
Uses TArrayTools, TStringTools, TNCLogger, TDeserialize

Table of Contents

CACHE_GET_CIRCLES  = 'circles/getCircles'
CACHE_GET_CIRCLES_TTL  = 300
$ALERT  : mixed
$CRITICAL  : mixed
$DEBUG  : mixed
$EMERGENCY  : mixed
$ERROR  : mixed
$INFO  : mixed
$NOTICE  : mixed
$TYPE_ARRAY  : mixed
$TYPE_BOOLEAN  : mixed
$TYPE_INTEGER  : mixed
$TYPE_NULL  : mixed
$TYPE_SERIALIZABLE  : mixed
$TYPE_STRING  : mixed
$WARNING  : mixed
$cache  : ICache
$circleRequest  : CircleRequest
$configService  : ConfigService
$federatedEventService  : FederatedEventService
$federatedUserService  : FederatedUserService
$hasher  : IHasher
$l10n  : IL10N
$memberRequest  : MemberRequest
$memberService  : MemberService
$permissionService  : PermissionService
$remoteStreamService  : RemoteStreamService
__construct()  : mixed
alert()  : void
circleJoin()  : array<string|int, mixed>
circleLeave()  : array<string|int, mixed>
cleanCircleName()  : string
confirmCircleNotFull()  : void
confirmName()  : void
create()  : array<string|int, mixed>
debug()  : void
deserialize()  : IDeserializable
deserializeArray()  : array<string|int, IDeserializable>
deserializeJson()  : IDeserializable
deserializeList()  : array<string|int, IDeserializable>
destroy()  : array<string|int, mixed>
e()  : void
emergency()  : void
exception()  : void
generateRandomSentence()  : string
generateRandomWord()  : string
generateSanitizedName()  : mixed
getCircle()  : Circle
getCircles()  : array<string|int, Circle>
getDateDiff()  : string
getDefinition()  : string
getDefinitionCircle()  : string
getDefinitionUser()  : string
humanReadable()  : string
isCircleFull()  : bool
log()  : void
logger()  : LoggerInterface
notice()  : void
probeCircle()  : Circle
probeCircles()  : array<string|int, mixed>
sanitizeName()  : string
serialize()  : array<string|int, mixed>
serializeArray()  : array<string|int, mixed>
t()  : void
throwable()  : void
typeOf()  : string
updateConfig()  : array<string|int, mixed>
updateDescription()  : array<string|int, mixed>
updateName()  : array<string|int, mixed>
updateSetting()  : array<string|int, mixed>
if $value is null, setting is unset
validKey()  : bool
warning()  : void
cleanArray()  : mixed
commonPart()  : string
cut()  : string
extractArray()  : mixed
feedStringWithParams()  : string
get()  : string
getArray()  : array<string|int, mixed>
getBool()  : bool
getFloat()  : float
getInt()  : int
getList()  : array<string|int, mixed>
getObj()  : mixed
isUuid()  : bool
mustContains()  : mixed
token()  : string
uuid()  : string
Generate uuid: 2b5a7a87-8db1-445f-a17b-405790f91c80
confirmDisplayName()  : mixed
generateGetCirclesCacheKey()  : string

Constants

CACHE_GET_CIRCLES

public mixed CACHE_GET_CIRCLES = 'circles/getCircles'

CACHE_GET_CIRCLES_TTL

public mixed CACHE_GET_CIRCLES_TTL = 300

Properties

$EMERGENCY

public static mixed $EMERGENCY = 4

$TYPE_ARRAY

public static mixed $TYPE_ARRAY = 'Array'

$TYPE_BOOLEAN

public static mixed $TYPE_BOOLEAN = 'Boolean'

$TYPE_INTEGER

public static mixed $TYPE_INTEGER = 'Integer'

$TYPE_SERIALIZABLE

public static mixed $TYPE_SERIALIZABLE = 'Serializable'

$TYPE_STRING

public static mixed $TYPE_STRING = 'String'

Methods

__construct()

public __construct(IL10N $l10n, IHasher $hasher, ICacheFactory $cacheFactory, CircleRequest $circleRequest, MemberRequest $memberRequest, RemoteStreamService $remoteStreamService, FederatedUserService $federatedUserService, FederatedEventService $federatedEventService, MemberService $memberService, PermissionService $permissionService, ConfigService $configService) : mixed
Parameters
$l10n : IL10N
$hasher : IHasher
$cacheFactory : ICacheFactory
$circleRequest : CircleRequest
$memberRequest : MemberRequest
$remoteStreamService : RemoteStreamService
$federatedUserService : FederatedUserService
$federatedEventService : FederatedEventService
$memberService : MemberService
$permissionService : PermissionService
$configService : ConfigService
Return values
mixed

alert()

public alert(string $message[, bool $trace = false ][, array<string|int, mixed> $serializable = [] ]) : void
Parameters
$message : string
$trace : bool = false
$serializable : array<string|int, mixed> = []
Return values
void

circleJoin()

public circleJoin(string $circleId) : array<string|int, mixed>
Parameters
$circleId : string
Tags
throws
CircleNotFoundException
throws
FederatedEventException
throws
FederatedItemException
throws
InitiatorNotConfirmedException
throws
InitiatorNotFoundException
throws
OwnerNotFoundException
throws
RemoteInstanceException
throws
RemoteNotFoundException
throws
RemoteResourceNotFoundException
throws
UnknownRemoteException
throws
RequestBuilderException
Return values
array<string|int, mixed>

circleLeave()

public circleLeave(string $circleId[, bool $force = false ]) : array<string|int, mixed>
Parameters
$circleId : string
$force : bool = false
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
array<string|int, mixed>

cleanCircleName()

public cleanCircleName(string $name) : string
Parameters
$name : string
Return values
string

create()

public create(string $name[, FederatedUser|null $owner = null ][, bool $personal = false ][, bool $local = false ]) : array<string|int, mixed>
Parameters
$name : string
$owner : FederatedUser|null = null
$personal : bool = false
$local : bool = false
Tags
throws
FederatedEventException
throws
FederatedItemException
throws
InitiatorNotConfirmedException
throws
InitiatorNotFoundException
throws
OwnerNotFoundException
throws
RemoteInstanceException
throws
RemoteNotFoundException
throws
RemoteResourceNotFoundException
throws
UnknownRemoteException
throws
RequestBuilderException
throws
CircleNameTooShortException
Return values
array<string|int, mixed>

debug()

public debug(string $message[, array<string|int, mixed> $serializable = [] ]) : void
Parameters
$message : string
$serializable : array<string|int, mixed> = []
Return values
void

deserializeArray()

public deserializeArray(array<string|int, mixed> $data, string $class[, bool $associative = false ]) : array<string|int, IDeserializable>
Parameters
$data : array<string|int, mixed>
$class : string
$associative : bool = false
Return values
array<string|int, IDeserializable>

destroy()

public destroy(string $circleId) : array<string|int, mixed>
Parameters
$circleId : 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
array<string|int, mixed>

e()

public e(Exception $e[, array<string|int, mixed> $serializable = [] ]) : void
Parameters
$e : Exception
$serializable : array<string|int, mixed> = []
Return values
void

emergency()

public emergency(string $message[, bool $trace = false ][, array<string|int, mixed> $serializable = [] ]) : void
Parameters
$message : string
$trace : bool = false
$serializable : array<string|int, mixed> = []
Return values
void

exception()

public exception(Exception $e[, int|array<string|int, mixed> $level = 3 ][, array<string|int, mixed> $serializable = [] ]) : void
Parameters
$e : Exception
$level : int|array<string|int, mixed> = 3
$serializable : array<string|int, mixed> = []
Return values
void

generateRandomSentence()

public generateRandomSentence([int $words = 5 ]) : string
Parameters
$words : int = 5
Return values
string

generateRandomWord()

public generateRandomWord([int $length = 8 ]) : string
Parameters
$length : int = 8
Return values
string

getDateDiff()

public getDateDiff(int $first, int $second[, bool $short = false ][, array<string|int, mixed> $words = [] ]) : string
Parameters
$first : int
$second : int
$short : bool = false
$words : array<string|int, mixed> = []
Tags
throws
Exception
Return values
string

getDefinitionCircle()

public getDefinitionCircle(Circle $circle) : string
Parameters
$circle : Circle
Return values
string

humanReadable()

public humanReadable(int $bytes) : string
Parameters
$bytes : int
Return values
string

log()

public log(int $level, string $message[, bool $trace = false ][, array<string|int, mixed> $serializable = [] ]) : void
Parameters
$level : int
$message : string
$trace : bool = false
$serializable : array<string|int, mixed> = []
Return values
void

logger()

public logger() : LoggerInterface
Return values
LoggerInterface

notice()

public notice(string $message[, bool $trace = false ][, array<string|int, mixed> $serializable = [] ]) : void
Parameters
$message : string
$trace : bool = false
$serializable : array<string|int, mixed> = []
Return values
void

sanitizeName()

public sanitizeName(string $name) : string
Parameters
$name : string
Return values
string

serialize()

public serialize(JsonSerializable $model) : array<string|int, mixed>
Parameters
$model : JsonSerializable
Return values
array<string|int, mixed>

serializeArray()

public serializeArray(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>
Return values
array<string|int, mixed>

t()

public t(Throwable $t[, array<string|int, mixed> $serializable = [] ]) : void
Parameters
$t : Throwable
$serializable : array<string|int, mixed> = []
Return values
void

throwable()

public throwable(Throwable $t[, int $level = 3 ][, array<string|int, mixed> $serializable = [] ]) : void
Parameters
$t : Throwable
$level : int = 3
$serializable : array<string|int, mixed> = []
Return values
void

typeOf()

public typeOf(string $key, array<string|int, mixed> $arr[, bool $root = true ]) : string
Parameters
$key : string
$arr : array<string|int, mixed>
$root : bool = true
Tags
throws
ItemNotFoundException
throws
UnknownTypeException
Return values
string

updateConfig()

public updateConfig(string $circleId, int $config) : array<string|int, mixed>
Parameters
$circleId : string
$config : int
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
array<string|int, mixed>

updateDescription()

public updateDescription(string $circleId, string $description) : array<string|int, mixed>
Parameters
$circleId : string
$description : 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
array<string|int, mixed>

updateName()

public updateName(string $circleId, string $name) : array<string|int, mixed>
Parameters
$circleId : string
$name : 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
array<string|int, mixed>

updateSetting()

if $value is null, setting is unset

public updateSetting(string $circleId, string $setting, string|null $value) : array<string|int, mixed>
Parameters
$circleId : string
$setting : string
$value : string|null
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
array<string|int, mixed>

validKey()

public validKey(string $k, array<string|int, mixed> $arr) : bool
Parameters
$k : string
$arr : array<string|int, mixed>
Return values
bool

warning()

public warning(string $message[, bool $trace = false ][, array<string|int, mixed> $serializable = [] ]) : void
Parameters
$message : string
$trace : bool = false
$serializable : array<string|int, mixed> = []
Return values
void

cleanArray()

protected cleanArray(array<string|int, mixed> &$arr) : mixed
Parameters
$arr : array<string|int, mixed>
Return values
mixed

commonPart()

protected commonPart(string $str1, string $str2[, bool $cs = true ]) : string
Parameters
$str1 : string
$str2 : string
$cs : bool = true

case sensitive ?

Return values
string

cut()

protected cut(string $line, int $length) : string
Parameters
$line : string
$length : int
Return values
string

extractArray()

protected extractArray(string $k, string $value, array<string|int, mixed> $list) : mixed
Parameters
$k : string
$value : string
$list : array<string|int, mixed>
Tags
throws
ArrayNotFoundException
Return values
mixed

feedStringWithParams()

protected feedStringWithParams(string $line, array<string|int, mixed> $params) : string
Parameters
$line : string
$params : array<string|int, mixed>
Return values
string

get()

protected get(string $k, array<string|int, mixed> $arr[, string $default = '' ]) : string
Parameters
$k : string
$arr : array<string|int, mixed>
$default : string = ''
Return values
string

getArray()

protected getArray(string $k, array<string|int, mixed> $arr[, array<string|int, mixed> $default = [] ]) : array<string|int, mixed>
Parameters
$k : string
$arr : array<string|int, mixed>
$default : array<string|int, mixed> = []
Return values
array<string|int, mixed>

getBool()

protected getBool(string $k, array<string|int, mixed> $arr[, bool $default = false ]) : bool
Parameters
$k : string
$arr : array<string|int, mixed>
$default : bool = false
Return values
bool

getFloat()

protected getFloat(string $k, array<string|int, mixed> $arr, float $default) : float
Parameters
$k : string
$arr : array<string|int, mixed>
$default : float
Return values
float

getInt()

protected getInt(string $k, array<string|int, mixed> $arr, int $default) : int
Parameters
$k : string
$arr : array<string|int, mixed>
$default : int
Return values
int

getList()

protected getList(string $k, array<string|int, mixed> $arr, array<string|int, mixed> $import[, array<string|int, mixed> $default = [] ]) : array<string|int, mixed>
Parameters
$k : string
$arr : array<string|int, mixed>
$import : array<string|int, mixed>
$default : array<string|int, mixed> = []
Return values
array<string|int, mixed>

getObj()

protected getObj(string $k, array<string|int, mixed> $arr[, JsonSerializable|null $default = null ]) : mixed
Parameters
$k : string
$arr : array<string|int, mixed>
$default : JsonSerializable|null = null
Return values
mixed

isUuid()

protected isUuid(string $uuid) : bool
Parameters
$uuid : string
Return values
bool

mustContains()

protected mustContains(array<string|int, mixed> $keys, array<string|int, mixed> $arr) : mixed
Parameters
$keys : array<string|int, mixed>
$arr : array<string|int, mixed>
Tags
throws
MalformedArrayException
Return values
mixed

token()

protected token([int $length = 15 ]) : string
Parameters
$length : int = 15
Return values
string

uuid()

Generate uuid: 2b5a7a87-8db1-445f-a17b-405790f91c80

protected uuid(int $length) : string
Parameters
$length : int
Return values
string

generateGetCirclesCacheKey()

private generateGetCirclesCacheKey(FederatedUser $federatedUser, string $probeSum) : string
Parameters
$federatedUser : FederatedUser
$probeSum : string
Return values
string

Search results