Nextcloud Circles API

Circle extends ManagedModel
in package
implements IEntity, IDeserializable, IQueryRow, JsonSerializable Uses TArrayTools, TDeserialize

Class Circle

** examples of use of bitwise flags for members management: CFG_OPEN, CFG_REQUEST, CFG_INVITE, CFG_FRIEND

  • CFG_OPEN => everyone can enter. moderator can add members.

  • CFG_OPEN | CFG_REQUEST => anyone can initiate a request to join the circle, moderator can add members

  • CFG_OPEN | CFG_INVITE => every one can enter, moderator must send invitation.

  • CFG_OPEN | CFG_INVITE | CFG_REQUEST => every one send a request, moderator must send invitation.

  • CFG_OPEN | CFG_FRIEND => useless

  • CFG_OPEN | CFG_FRIEND | * => useless

  • CFG_CIRCLE => no one can enter, moderator can add members. default config, this is only for code readability.

  • CFG_INVITE => no one can enter, moderator must send invitation.

  • CFG_FRIEND => no one can enter, but all members can add new member.

  • CFG_REQUEST => useless (use CFG_OPEN | CFG_REQUEST)

  • CFG_FRIEND | CFG_REQUEST => no one can join the circle, but all members can request a moderator to accept new member

  • CFG_FRIEND | CFG_INVITE => no one can join the circle, but all members can add new member. An invitation will be generated

  • CFG_FRIEND | CFG_INVITE | CFG_REQUEST => no one can join the circle, but all members can request a moderator to accept new member. An invitation will be generated

Interfaces, Classes, Traits and Enums

IEntity
Interface IMemberships
IDeserializable
IQueryRow
Interface IQueryRow
JsonSerializable

Table of Contents

CFG_APP  = 131072
CFG_BACKEND  = 2048
CFG_CIRCLE  = 0
CFG_CIRCLE_INVITE  = 16384
CFG_FEDERATED  = 32768
CFG_FRIEND  = 128
CFG_HIDDEN  = 1024
CFG_INVITE  = 32
CFG_LOCAL  = 4096
CFG_MOUNTPOINT  = 65536
CFG_NO_OWNER  = 512
CFG_OPEN  = 16
CFG_PERSONAL  = 2
CFG_PROTECTED  = 256
CFG_REQUEST  = 64
CFG_ROOT  = 8192
CFG_SINGLE  = 1
CFG_SYSTEM  = 4
CFG_VISIBLE  = 8
FLAGS_LONG  = 2
FLAGS_SHORT  = 1
ID_LENGTH  = 31
$DEF_CFG  : array<string|int, mixed>
Note: When editing those values, update lib/Application/Capabilities.php
$DEF_CFG_CORE_FILTER  : mixed
$DEF_CFG_MAX  : mixed
$DEF_CFG_SYSTEM_FILTER  : mixed
$DEF_SOURCE  : array<string|int, mixed>
Note: When editing those values, update lib/Application/Capabilities.php
$TYPE_ARRAY  : mixed
$TYPE_BOOLEAN  : mixed
$TYPE_INTEGER  : mixed
$TYPE_NULL  : mixed
$TYPE_SERIALIZABLE  : mixed
$TYPE_STRING  : mixed
$config  : int
$contactAddressBook  : int
$contactGroupName  : string
$creation  : int
$description  : string
$detailedInheritedMember  : bool
$directInitiator  : Member
$displayName  : string
$inheritedMembers  : array<string|int, Member>
$initiator  : Member
$instance  : string
$members  : array<string|int, Member>
$memberships  : array<string|int, Membership>
$modelManager  : ModelManager
$name  : string
$owner  : Member
$population  : int
$populationInherited  : int
$sanitizedName  : string
$settings  : array<string|int, mixed>
$singleId  : string
$source  : int
__construct()  : mixed
Circle constructor.
addConfig()  : void
addInheritedMembers()  : Circle
compareWith()  : bool
deserialize()  : IDeserializable
deserializeArray()  : array<string|int, IDeserializable>
deserializeJson()  : IDeserializable
deserializeList()  : array<string|int, IDeserializable>
getCircleFlags()  : array<string|int, mixed>
getConfig()  : int
getContactAddressBook()  : int
getContactGroupName()  : string
getCreation()  : int
getDescription()  : string
getDisplayName()  : string
getInheritedMembers()  : array<string|int, Member>
if $remote is true, it will returns also details on inherited members from remote+locals Circles.
getInitiator()  : Member
getInstance()  : string
getLink()  : Membership
getMembers()  : array<string|int, Member>
getMemberships()  : array<string|int, Membership>
getName()  : string
getOwner()  : Member
getPopulation()  : int
getPopulationInherited()  : int
getSanitizedName()  : string
getSettings()  : array<string|int, mixed>
getSingleId()  : string
getSource()  : int
getUniqueId()  : string
getUrl()  : string
hasInitiator()  : bool
hasMembers()  : bool
hasMemberships()  : bool
hasOwner()  : bool
import()  : $this
importFromDatabase()  : IQueryRow
import data to feed the model.
importFromIFederatedUser()  : void
isConfig()  : bool
isLocal()  : bool
jsonSerialize()  : array<string|int, mixed>
remConfig()  : void
serialize()  : array<string|int, mixed>
serializeArray()  : array<string|int, mixed>
setConfig()  : self
setContactAddressBook()  : self
setContactGroupName()  : self
setCreation()  : self
setDescription()  : self
setDirectInitiator()  : $this
setDisplayName()  : self
setInheritedMembers()  : self
setInitiator()  : Circle
setInstance()  : Circle
setMembers()  : self
setMemberships()  : self
setName()  : self
setOwner()  : self
setPopulation()  : Circle
setPopulationInherited()  : Circle
setSanitizedName()  : Circle
setSettings()  : self
setSingleId()  : self
setSource()  : Circle
typeOf()  : string
validKey()  : bool
cleanArray()  : mixed
extractArray()  : mixed
get()  : string
getArray()  : array<string|int, mixed>
getBool()  : bool
getFloat()  : float
getInt()  : int
getList()  : array<string|int, mixed>
getManager()  : ModelManager
getObj()  : mixed
mustContains()  : mixed

Constants

CFG_APP

public mixed CFG_APP = 131072

CFG_BACKEND

public mixed CFG_BACKEND = 2048

CFG_CIRCLE

public mixed CFG_CIRCLE = 0

CFG_CIRCLE_INVITE

public mixed CFG_CIRCLE_INVITE = 16384

CFG_FEDERATED

public mixed CFG_FEDERATED = 32768

CFG_FRIEND

public mixed CFG_FRIEND = 128

CFG_HIDDEN

public mixed CFG_HIDDEN = 1024

CFG_INVITE

public mixed CFG_INVITE = 32

CFG_LOCAL

public mixed CFG_LOCAL = 4096

CFG_MOUNTPOINT

public mixed CFG_MOUNTPOINT = 65536

CFG_NO_OWNER

public mixed CFG_NO_OWNER = 512

CFG_OPEN

public mixed CFG_OPEN = 16

CFG_PERSONAL

public mixed CFG_PERSONAL = 2

CFG_PROTECTED

public mixed CFG_PROTECTED = 256

CFG_REQUEST

public mixed CFG_REQUEST = 64

CFG_ROOT

public mixed CFG_ROOT = 8192

CFG_SINGLE

public mixed CFG_SINGLE = 1

CFG_SYSTEM

public mixed CFG_SYSTEM = 4

CFG_VISIBLE

public mixed CFG_VISIBLE = 8

FLAGS_LONG

public mixed FLAGS_LONG = 2

FLAGS_SHORT

public mixed FLAGS_SHORT = 1

Properties

$DEF_CFG

Note: When editing those values, update lib/Application/Capabilities.php

public static array<string|int, mixed> $DEF_CFG = [1 => 'S|Single', 2 => 'P|Personal', 4 => 'Y|System', 8 => 'V|Visible', 16 => 'O|Open', 32 => 'I|Invite', 64 => 'JR|Join Request', 128 => 'F|Friends', 256 => 'PP|Password Protected', 512 => 'NO|No Owner', 1024 => 'H|Hidden', 2048 => 'T|Backend', 4096 => 'L|Local', 8192 => 'T|Root', 16384 => 'CI|Circle Invite', 32768 => 'F|Federated', 65536 => 'M|Nountpoint', 131072 => 'A|App']
Tags
see
Capabilities::getCapabilitiesCircleConstants()

$DEF_CFG_CORE_FILTER

public static mixed $DEF_CFG_CORE_FILTER = [1, 2, 4]

$DEF_CFG_MAX

public static mixed $DEF_CFG_MAX = 262143

$DEF_CFG_SYSTEM_FILTER

public static mixed $DEF_CFG_SYSTEM_FILTER = [512, 1024, 2048]

$DEF_SOURCE

Note: When editing those values, update lib/Application/Capabilities.php

public static array<string|int, mixed> $DEF_SOURCE = [1 => 'Nextcloud Account', 2 => 'Nextcloud Group', 4 => 'Email Address', 8 => 'Contact', 16 => 'Circle', 10000 => 'Nextcloud App', 10001 => 'Circles App', 10002 => 'Admin Command Line', 11000 => '3rd party app', 11010 => 'Collectives App']
Tags
see
Capabilities::getCapabilitiesCircleConstants()

$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'

$config

private int $config = 0

$contactAddressBook

private int $contactAddressBook = 0

$contactGroupName

private string $contactGroupName = ''

$creation

private int $creation = 0

$description

private string $description = ''

$detailedInheritedMember

private bool $detailedInheritedMember = false

$displayName

private string $displayName = ''

$inheritedMembers

private array<string|int, Member> $inheritedMembers = null

$instance

private string $instance = ''

$name

private string $name = ''

$population

private int $population = 0

$populationInherited

private int $populationInherited = 0

$sanitizedName

private string $sanitizedName = ''

$settings

private array<string|int, mixed> $settings = []

$singleId

private string $singleId = ''

$source

private int $source = 0

Methods

__construct()

Circle constructor.

public __construct() : mixed
Return values
mixed

addConfig()

public addConfig(int $flag) : void
Parameters
$flag : int
Return values
void

addInheritedMembers()

public addInheritedMembers(array<string|int, Member$members) : Circle
Parameters
$members : array<string|int, Member>
Return values
Circle

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>

getCircleFlags()

public static getCircleFlags(Circle $circle[, int $display = self::FLAGS_LONG ]) : array<string|int, mixed>
Parameters
$circle : Circle
$display : int = self::FLAGS_LONG
Return values
array<string|int, mixed>

getConfig()

public getConfig() : int
Return values
int

getContactAddressBook()

public getContactAddressBook() : int
Return values
int

getContactGroupName()

public getContactGroupName() : string
Return values
string

getCreation()

public getCreation() : int
Return values
int

getDescription()

public getDescription() : string
Return values
string

getDisplayName()

public getDisplayName() : string
Return values
string

getInheritedMembers()

if $remote is true, it will returns also details on inherited members from remote+locals Circles.

public getInheritedMembers([bool $detailed = false ][, bool $remote = false ]) : array<string|int, Member>

This should be used only if extra details are required (mail address ?) as it will send a request to the remote instance if the circleId is not locally known. because of the resource needed to retrieve this data, $remote=true should not be used on main process !

Parameters
$detailed : bool = false
$remote : bool = false
Tags
throws
FederatedItemException
throws
RemoteInstanceException
throws
RemoteNotFoundException
throws
RemoteResourceNotFoundException
throws
RequestBuilderException
throws
UnknownRemoteException
Return values
array<string|int, Member>

getMembers()

public getMembers() : array<string|int, Member>
Return values
array<string|int, Member>

getName()

public getName() : string
Return values
string

getPopulation()

public getPopulation() : int
Return values
int

getPopulationInherited()

public getPopulationInherited() : int
Return values
int

getSanitizedName()

public getSanitizedName() : string
Return values
string

getSettings()

public getSettings() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSingleId()

public getSingleId() : string
Return values
string

getSource()

public getSource() : int
Return values
int

getUniqueId()

public getUniqueId() : string
Tags
deprecated
  • removed in NC23
Return values
string

getUrl()

public getUrl() : string
Return values
string

hasInitiator()

public hasInitiator() : bool
Return values
bool

hasMembers()

public hasMembers() : bool
Return values
bool

hasMemberships()

public hasMemberships() : bool
Return values
bool

hasOwner()

public hasOwner() : bool
Return values
bool

import()

public import(array<string|int, mixed> $data) : $this
Parameters
$data : array<string|int, mixed>
Tags
throws
InvalidItemException
Return values
$this

importFromDatabase()

import data to feed the model.

public importFromDatabase(array<string|int, mixed> $data[, string $prefix = '' ]) : IQueryRow
Parameters
$data : array<string|int, mixed>
$prefix : string = ''
Tags
throws
CircleNotFoundException
Return values
IQueryRow

importFromIFederatedUser()

public importFromIFederatedUser(IFederatedUser $orig) : void
Parameters
$orig : IFederatedUser
Tags
noinspection

PhpPossiblePolymorphicInvocationInspection

Return values
void

isConfig()

public isConfig(int $flag, int $test) : bool
Parameters
$flag : int
$test : int
Return values
bool

remConfig()

public remConfig(int $flag) : void
Parameters
$flag : int
Return values
void

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>

setConfig()

public setConfig(int $config) : self
Parameters
$config : int
Return values
self

setContactAddressBook()

public setContactAddressBook(int $contactAddressBook) : self
Parameters
$contactAddressBook : int
Return values
self

setContactGroupName()

public setContactGroupName(string $contactGroupName) : self
Parameters
$contactGroupName : string
Return values
self

setCreation()

public setCreation(int $creation) : self
Parameters
$creation : int
Return values
self

setDescription()

public setDescription(string $description) : self
Parameters
$description : string
Return values
self

setDirectInitiator()

public setDirectInitiator(Member|null $directInitiator) : $this
Parameters
$directInitiator : Member|null
Return values
$this

setDisplayName()

public setDisplayName(string $displayName) : self
Parameters
$displayName : string
Return values
self

setInheritedMembers()

public setInheritedMembers(array<string|int, mixed> $members, bool $detailed) : self
Parameters
$members : array<string|int, mixed>
$detailed : bool
Return values
self

setInstance()

public setInstance(string $instance) : Circle
Parameters
$instance : string
Return values
Circle

setMembers()

public setMembers(array<string|int, Member$members) : self
Parameters
$members : array<string|int, Member>
Return values
self

setMemberships()

public setMemberships(array<string|int, mixed> $memberships) : self
Parameters
$memberships : array<string|int, mixed>
Return values
self

setName()

public setName(string $name) : self
Parameters
$name : string
Return values
self

setOwner()

public setOwner(Member|null $owner) : self
Parameters
$owner : Member|null
Return values
self

setPopulation()

public setPopulation(int $population) : Circle
Parameters
$population : int
Return values
Circle

setPopulationInherited()

public setPopulationInherited(int $population) : Circle
Parameters
$population : int
Return values
Circle

setSanitizedName()

public setSanitizedName(string $sanitizedName) : Circle
Parameters
$sanitizedName : string
Return values
Circle

setSettings()

public setSettings(array<string|int, mixed> $settings) : self
Parameters
$settings : array<string|int, mixed>
Return values
self

setSingleId()

public setSingleId(string $singleId) : self
Parameters
$singleId : string
Return values
self

setSource()

public setSource(int $source) : Circle
Parameters
$source : int
Return values
Circle

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

validKey()

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

cleanArray()

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

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

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

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

Search results