IPreloadableNotifier
extends
INotifier
in
Allow notifier implementations to preload and cache data for many notifications at once to improve performance by, for example, bundling SQL queries.
Attributes
- #[Implementable]
- $since: '32.0.0'
Table of Contents
Methods
- getID() : string
- Identifier of the notifier, only use [a-z0-9_]
- getName() : string
- Human-readable name describing the notifier
- preloadDataForParsing() : void
- This method provides a way for notifier implementations to preload and cache data for many notifications. The data is meant to be consumed later in the {@see INotifier::prepare()} method to improve performance.
- prepare() : INotification
Methods
getID()
Identifier of the notifier, only use [a-z0-9_]
public
getID() : string
Tags
Return values
stringgetName()
Human-readable name describing the notifier
public
getName() : string
Tags
Return values
stringpreloadDataForParsing()
This method provides a way for notifier implementations to preload and cache data for many notifications. The data is meant to be consumed later in the {@see INotifier::prepare()} method to improve performance.
public
preloadDataForParsing(array<string|int, INotification> $notifications, string $languageCode, NotificationPreloadReason $reason) : void
Parameters
- $notifications : array<string|int, INotification>
-
The notifications which are about to be prepared in the next step.
- $languageCode : string
-
The code of the language that should be used to prepare the notification.
- $reason : NotificationPreloadReason
-
The reason for preloading the given notifications to facilitate smarter decisions about what data to preload.
Tags
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