|
MediaWiki master
|
Inherited by MediaWiki\Notification\Types\SimpleNotification, MediaWiki\Notification\Types\WikiNotification, and MediaWiki\User\WelcomeNotification.
Public Member Functions | |
| __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. | |
Protected Attributes | |
| string string | $type |
Definition at line 13 of file Notification.php.
| MediaWiki\Notification\Notification::__construct | ( | string | $type, |
| array | $custom = [] ) |
Base for Notifications.
Type is the only required property, and any additional data can be passed via $custom array.
| string | $type | Notification type |
| (scalar|array|null|JsonCodecable)[] | $custom Custom notification data, see setProperty() for more details about the allowed keys and values |
Definition at line 44 of file Notification.php.
References MediaWiki\Notification\Notification\$type.
| MediaWiki\Notification\Notification::getProperties | ( | ) |
Retrieve Notification properties.
Definition at line 73 of file Notification.php.
| MediaWiki\Notification\Notification::getType | ( | ) |
Get the Notification type.
Definition at line 52 of file Notification.php.
| MediaWiki\Notification\Notification::setProperty | ( | string | $key, |
| $value ) |
Sets a custom property to the notification.
Any other keys may be used to pass additional data handled by specific extensions.* The value of keys other than those listed above should be (de)serializable as JSON, by either being scalar or array containing scalar values or using the JsonCodecable interface.
| string | $key | |
| scalar | array | JsonCodecable | $value |
Definition at line 66 of file Notification.php.
|
protected |
namespace.type, like mediawiki.message, growth.welcome. This way we can easily "override" some notifications, for example, we can have echo.mention, and the echo.mention could supersede mediawiki.mention. Also, it will be more difficult for notifications to conflict, and we will be able to easily filter apply logic depends on the namespace (for example, hide if extension not present).Required, Read-only - The Notification type
Definition at line 26 of file Notification.php.
Referenced by MediaWiki\Notification\Notification\__construct(), and MediaWiki\Notification\Types\WikiNotification\__construct().