From c3420fface77c584ae83bf20f36ec192399e5e09 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 16 Sep 2015 14:48:07 +0200 Subject: Allow checking whether there are notifiers registered --- lib/private/notification/imanager.php | 6 ++++++ lib/private/notification/manager.php | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/lib/private/notification/imanager.php b/lib/private/notification/imanager.php index 0cd92b33251..f4a5fb14e31 100644 --- a/lib/private/notification/imanager.php +++ b/lib/private/notification/imanager.php @@ -53,4 +53,10 @@ interface IManager extends IApp, INotifier { * @since 8.2.0 */ public function createNotification(); + + /** + * @return bool + * @since 8.2.0 + */ + public function hasNotifiers(); } diff --git a/lib/private/notification/manager.php b/lib/private/notification/manager.php index 9635925e38e..0d5bb9be514 100644 --- a/lib/private/notification/manager.php +++ b/lib/private/notification/manager.php @@ -112,6 +112,14 @@ class Manager implements IManager { return new Notification(); } + /** + * @return bool + * @since 8.2.0 + */ + public function hasNotifiers() { + return !empty($this->notifiersClosures); + } + /** * @param INotification $notification * @return null -- cgit v1.2.3