Nextcloud PHP API (master)

IDismissableNotifier extends INotifier

Interface INotifier classes should implement if they want to process notifications that are dismissed by the user.

This can be useful if dismissing the notification will leave it in an incomplete state. The handler can choose to for example do some default action.

Tags
since
18.0.0

Table of Contents

Methods

dismissNotification()  : void
getID()  : string
Identifier of the notifier, only use [a-z0-9_]
getName()  : string
Human-readable name describing the notifier
prepare()  : INotification

Methods

dismissNotification()

public dismissNotification(INotification $notification) : void
Parameters
$notification : INotification
Tags
throws
UnknownNotificationException

when the notifier is not in charge of the notification

since
18.0.0
since
30.0.0

Notifiers should throw UnknownNotificationException instead of \InvalidArgumentException when they did not handle the notification. Throwing \InvalidArgumentException directly is deprecated and will be logged as an error in Nextcloud 39.

getID()

Identifier of the notifier, only use [a-z0-9_]

public getID() : string
Tags
since
17.0.0
Return values
string

getName()

Human-readable name describing the notifier

public getName() : string
Tags
since
17.0.0
Return values
string

prepare()

public prepare(INotification $notification, string $languageCode) : INotification
Parameters
$notification : INotification
$languageCode : string

The code of the language that should be used to prepare the notification

Tags
throws
UnknownNotificationException

When the notification was not prepared by a notifier

throws
AlreadyProcessedException

When the notification is not needed anymore and should be deleted

throws
IncompleteParsedNotificationException

Only to be thrown by the IManager

since
9.0.0
since
30.0.0

Notifiers should throw UnknownNotificationException instead of \InvalidArgumentException when they did not handle the notification. Throwing \InvalidArgumentException directly is deprecated and will be logged as an error in Nextcloud 39.

since
30.0.0

Throws IncompleteParsedNotificationException when not all required fields are set at the end of the manager or after a INotifier that claimed to have parsed the notification.

Return values
INotification

        
On this page

Search results