diff options
Diffstat (limited to 'lib/public/Notification/IPreloadableNotifier.php')
-rw-r--r-- | lib/public/Notification/IPreloadableNotifier.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/public/Notification/IPreloadableNotifier.php b/lib/public/Notification/IPreloadableNotifier.php new file mode 100644 index 00000000000..2bdcd84d254 --- /dev/null +++ b/lib/public/Notification/IPreloadableNotifier.php @@ -0,0 +1,31 @@ +<?php + +declare(strict_types=1); + +/** + * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +namespace OCP\Notification; + +use OCP\AppFramework\Attribute\Implementable; + +/** + * Allow notifier implementations to preload and cache data for many notifications at once to + * improve performance by, for example, bundling SQL queries. + */ +#[Implementable(since: '32.0.0')] +interface IPreloadableNotifier extends INotifier { + /** + * 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. + * + * @since 32.0.0 + * + * @param INotification[] $notifications The notifications which are about to be prepared in the next step. + * @param string $languageCode The code of the language that should be used to prepare the notification. + */ + public function preloadDataForParsing(array $notifications, string $languageCode): void; +} |