Documentation

User extends Principal
in package
implements ICollection

CalDAV principal.

This is a standard user-principal for CalDAV. This principal is also a collection and returns the caldav-proxy-read and caldav-proxy-write child principals.

Tags
copyright

Copyright (C) fruux GmbH (https://fruux.com/)

author

Evert Pot (http://evertpot.com/)

license

http://sabre.io/license/ Modified BSD License

Interfaces, Classes and Traits

ICollection
The ICollection Interface.

Table of Contents

$principalBackend  : BackendInterface
Principal backend.
$principalProperties  : array<string|int, mixed>
Struct with principal information.
__construct()  : mixed
Creates the principal object.
childExists()  : bool
Returns whether or not the child node exists.
createDirectory()  : mixed
Creates a new subdirectory.
createFile()  : string|null
Creates a new file in the directory.
delete()  : mixed
Deletes the current node.
getACL()  : array<string|int, mixed>
Returns a list of ACE's for this node.
getAlternateUriSet()  : array<string|int, mixed>
Returns a list of alternative urls for a principal.
getChild()  : INode
Returns a specific child node, referenced by its name.
getChildren()  : array<string|int, INode>
Returns an array with all the child nodes.
getDisplayName()  : string
Returns the name of the user.
getGroup()  : string|null
Returns a group principal.
getGroupMemberSet()  : array<string|int, mixed>
Returns the list of group members.
getGroupMembership()  : array<string|int, mixed>
Returns the list of groups this principal is member of.
getLastModified()  : int
Returns the last modification time as a unix timestamp.
getName()  : string
Returns this principals name.
getOwner()  : string|null
Returns the owner principal.
getPrincipalUrl()  : string
Returns the full principal url.
getProperties()  : array<string|int, mixed>
Returns a list of properties.
getSupportedPrivilegeSet()  : array<string|int, mixed>|null
Returns the list of supported privileges for this node.
propPatch()  : mixed
Updates properties on this node.
setACL()  : mixed
Updates the ACL.
setGroupMemberSet()  : mixed
Sets a list of group members.
setName()  : mixed
Renames the node.

Properties

$principalProperties

Struct with principal information.

protected array<string|int, mixed> $principalProperties

Methods

__construct()

Creates the principal object.

public __construct(BackendInterface $principalBackend[, array<string|int, mixed> $principalProperties = [] ]) : mixed
Parameters
$principalBackend : BackendInterface
$principalProperties : array<string|int, mixed> = []
Return values
mixed

childExists()

Returns whether or not the child node exists.

public childExists(string $name) : bool
Parameters
$name : string
Return values
bool

createDirectory()

Creates a new subdirectory.

public createDirectory(string $name) : mixed
Parameters
$name : string
Tags
throws
Forbidden
Return values
mixed

createFile()

Creates a new file in the directory.

public createFile(string $name[, resource $data = null ]) : string|null
Parameters
$name : string

Name of the file

$data : resource = null

initial payload, passed as a readable stream resource

Tags
throws
Forbidden
Return values
string|null

delete()

Deletes the current node.

public delete() : mixed
Tags
throws
Forbidden
Return values
mixed

getACL()

Returns a list of ACE's for this node.

public getACL() : array<string|int, mixed>

Each ACE has the following properties:

  • 'privilege', a string such as {DAV:}read or {DAV:}write. These are currently the only supported privileges
  • 'principal', a url to the principal who owns the node
  • 'protected' (optional), indicating that this ACE is not allowed to be updated.
Return values
array<string|int, mixed>

getAlternateUriSet()

Returns a list of alternative urls for a principal.

public getAlternateUriSet() : array<string|int, mixed>

This can for example be an email address, or ldap url.

Return values
array<string|int, mixed>

getChild()

Returns a specific child node, referenced by its name.

public getChild(string $name) : INode
Parameters
$name : string
Return values
INode

getChildren()

Returns an array with all the child nodes.

public getChildren() : array<string|int, INode>
Return values
array<string|int, INode>

getDisplayName()

Returns the name of the user.

public getDisplayName() : string
Return values
string

getGroup()

Returns a group principal.

public getGroup() : string|null

This must be a url to a principal, or null if there's no owner

Return values
string|null

getGroupMemberSet()

Returns the list of group members.

public getGroupMemberSet() : array<string|int, mixed>

If this principal is a group, this function should return all member principal uri's for the group.

Return values
array<string|int, mixed>

getGroupMembership()

Returns the list of groups this principal is member of.

public getGroupMembership() : array<string|int, mixed>

If this principal is a member of a (list of) groups, this function should return a list of principal uri's for it's members.

Return values
array<string|int, mixed>

getLastModified()

Returns the last modification time as a unix timestamp.

public getLastModified() : int

If the information is not available, return null.

Return values
int

getName()

Returns this principals name.

public getName() : string
Return values
string

getOwner()

Returns the owner principal.

public getOwner() : string|null

This must be a url to a principal, or null if there's no owner

Return values
string|null

getPrincipalUrl()

Returns the full principal url.

public getPrincipalUrl() : string
Return values
string

getProperties()

Returns a list of properties.

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

getSupportedPrivilegeSet()

Returns the list of supported privileges for this node.

public getSupportedPrivilegeSet() : array<string|int, mixed>|null

The returned data structure is a list of nested privileges. See Sabre\DAVACL\Plugin::getDefaultSupportedPrivilegeSet for a simple standard structure.

If null is returned from this method, the default privilege set is used, which is fine for most common usecases.

Return values
array<string|int, mixed>|null

propPatch()

Updates properties on this node.

public propPatch(PropPatch $propPatch) : mixed

This method received a PropPatch object, which contains all the information about the update.

To update specific properties, call the 'handle' method on this object. Read the PropPatch documentation for more information.

Parameters
$propPatch : PropPatch
Return values
mixed

setACL()

Updates the ACL.

public setACL(array<string|int, mixed> $acl) : mixed

This method will receive a list of new ACE's as an array argument.

Parameters
$acl : array<string|int, mixed>
Return values
mixed

setGroupMemberSet()

Sets a list of group members.

public setGroupMemberSet(array<string|int, mixed> $groupMembers) : mixed

If this principal is a group, this method sets all the group members. The list of members is always overwritten, never appended to.

This method should throw an exception if the members could not be set.

Parameters
$groupMembers : array<string|int, mixed>
Return values
mixed

setName()

Renames the node.

public setName(string $name) : mixed
Parameters
$name : string

The new name

Tags
throws
Forbidden
Return values
mixed

Search results