MediaWiki master
MediaWiki\Notification\Types\WikiNotification Class Reference

A Notification to describe something was done by a user on specific page. More...

Inherits MediaWiki\Notification\Notification, MediaWiki\Notification\AgentAware, and MediaWiki\Notification\TitleAware.

Inherited by MediaWiki\RecentChanges\RecentChangeNotification.

Collaboration diagram for MediaWiki\Notification\Types\WikiNotification:

Public Member Functions

 __construct (string $type, PageIdentity $title, UserIdentity $agent, array $custom=[])
 Sets the agent (UserIdentity) who triggered this notification.
 
 getAgent ()
 
Returns
UserIdentity The user responsible for triggering this notification.

 
 getTitle ()
 Get the PageIdentity of the related page.
 
 setAgent (UserIdentity $agent)
 
- Public Member Functions inherited from MediaWiki\Notification\Notification
 __construct (string $type, array $custom=[])
 Base for Notifications.
 
 getProperties ()
 Retrieve Notification properties.
 
 getType ()
 Get the Notification type.
 
 setProperty (string $key, $value)
 Sets a custom property to the notification.
 

Additional Inherited Members

- Protected Attributes inherited from MediaWiki\Notification\Notification
string string $type
 

Detailed Description

A Notification to describe something was done by a user on specific page.

This notification requires both Title and Agent to be present.

In case you require a notification that doesn't provide both Agent and Title please provide your own Notification implementation.

Stability: newable
Since
1.45

Definition at line 21 of file WikiNotification.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Notification\Types\WikiNotification::__construct ( string $type,
PageIdentity $title,
UserIdentity $agent,
array $custom = [] )

Sets the agent (UserIdentity) who triggered this notification.

Parameters
string$typeNotification type
PageIdentity$titleThe title of the related page
UserIdentity$agentThe user responsible for triggering this notification.
(scalar|array|null|JsonCodecable)[]$custom Custom notification data, see setProperty() for more details about the allowed keys and values

Definition at line 42 of file WikiNotification.php.

References MediaWiki\Notification\Notification\$type.

Member Function Documentation

◆ getAgent()

MediaWiki\Notification\Types\WikiNotification::getAgent ( )

Returns
UserIdentity The user responsible for triggering this notification.

Implements MediaWiki\Notification\AgentAware.

Definition at line 61 of file WikiNotification.php.

◆ getTitle()

MediaWiki\Notification\Types\WikiNotification::getTitle ( )

Get the PageIdentity of the related page.

Implements MediaWiki\Notification\TitleAware.

Definition at line 68 of file WikiNotification.php.

◆ setAgent()

MediaWiki\Notification\Types\WikiNotification::setAgent ( UserIdentity $agent)

Definition at line 53 of file WikiNotification.php.


The documentation for this class was generated from the following file: