Node
extends File
in package
implements
INode, IACL
Uses
ACLTrait
This node represents a single notification.
The signature is mostly identical to that of Sabre\DAV\IFile, but the get() method MUST return an xml document that matches the requirements of the 'caldav-notifications.txt' spec.
Tags
Interfaces, Classes and Traits
Table of Contents
- $caldavBackend : NotificationSupport
- The notification backend.
- $notification : NotificationInterface
- The actual notification.
- $principalUri : string
- Owner principal of the notification.
- __construct() : mixed
- Constructor.
- delete() : mixed
- Deletes this notification.
- get() : mixed
- Returns the data.
- getACL() : array<string|int, mixed>
- Returns a list of ACE's for this node.
- getContentType() : string|null
- Returns the mime-type for a file.
- getETag() : string
- Returns the etag for the notification.
- getGroup() : string|null
- Returns a group principal.
- getLastModified() : int
- Returns the last modification time as a unix timestamp.
- getName() : string
- Returns the path name for this notification.
- getNotificationType() : NotificationInterface
- This method must return an xml element, using the Sabre\CalDAV\Xml\Notification\NotificationInterface classes.
- getOwner() : string|null
- Returns the owner principal.
- getSize() : int
- Returns the size of the file, in bytes.
- getSupportedPrivilegeSet() : array<string|int, mixed>|null
- Returns the list of supported privileges for this node.
- put() : string|null
- Replaces the contents of the file.
- setACL() : mixed
- Updates the ACL.
- setName() : mixed
- Renames the node.
Properties
$caldavBackend
The notification backend.
protected
NotificationSupport
$caldavBackend
$notification
The actual notification.
protected
NotificationInterface
$notification
$principalUri
Owner principal of the notification.
protected
string
$principalUri
Methods
__construct()
Constructor.
public
__construct(NotificationSupport $caldavBackend, string $principalUri, NotificationInterface $notification) : mixed
Parameters
- $caldavBackend : NotificationSupport
- $principalUri : string
- $notification : NotificationInterface
Return values
mixed —delete()
Deletes this notification.
public
delete() : mixed
Return values
mixed —get()
Returns the data.
public
get() : mixed
This method may either return a string or a readable stream resource
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> —getContentType()
Returns the mime-type for a file.
public
getContentType() : string|null
If null is returned, we'll assume application/octet-stream
Return values
string|null —getETag()
Returns the etag for the notification.
public
getETag() : string
The etag must be surrounded by litteral double-quotes.
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 —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 the path name for this notification.
public
getName() : string
Return values
string —getNotificationType()
This method must return an xml element, using the Sabre\CalDAV\Xml\Notification\NotificationInterface classes.
public
getNotificationType() : NotificationInterface
Return values
NotificationInterface —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 —getSize()
Returns the size of the file, in bytes.
public
getSize() : int
Return values
int —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 —put()
Replaces the contents of the file.
public
put(string|resource $data) : string|null
The data argument is a readable stream resource.
After a successful put operation, you may choose to return an ETag. The etag must always be surrounded by double-quotes. These quotes must appear in the actual string you're returning.
Clients may use the ETag from a PUT request to later on make sure that when they update the file, the contents haven't changed in the mean time.
If you don't plan to store the file byte-by-byte, and you return a different object on a subsequent GET you are strongly recommended to not return an ETag, and just return null.
Parameters
- $data : string|resource
Return values
string|null —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 —setName()
Renames the node.
public
setName(string $name) : mixed
Parameters
- $name : string
-
The new name