19declare(strict_types=1);
24use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
69 foreach ($this->providers as $provider) {
70 yield $provider->getNotifications();
79 foreach ($this->providers as $provider) {
80 yield $provider->getAdministrativeNotifications();
92 $this->administrative_notifications = array_filter($this->administrative_notifications,
static function (
AdministrativeNotification $n) :
bool {
93 return $n->isVisible();
123 return (is_array($this->notifications) && count($this->notifications) > 0);
140 if (is_array($this->notifications)) {
142 foreach ($this->notifications as $notification) {
144 foreach ($notification->getNotifications() as $s_notification) {
145 if ($s_notification->getOldAmount() > 0) {
150 if ($notification->getOldAmount() > 0) {
169 if (is_array($this->notifications)) {
171 foreach ($this->notifications as $notification) {
173 foreach ($notification->getNotifications() as $s_notification) {
174 if ($s_notification->getNewAmount() > 0) {
179 if ($notification->getNewAmount() > 0) {
214 foreach ($this->notifications as $notification) {
216 foreach ($notification->getNotifications() as $item) {
218 $identifiers[] = $this->hash($item->getProviderIdentification()->serialize());
220 $identifiers[] = $item->getProviderIdentification()->serialize();
225 $identifiers[] = $this->hash($notification->getProviderIdentification()->serialize());
227 $identifiers[] = $notification->getProviderIdentification()->serialize();
An exception for terminatinating execution or to throw for unit testing.
Class AbstractBaseCollector.
collectOnce()
Runs the Collection of all items from the providers.
Class MainNotificationCollector.
filterItemsByVisibilty(bool $async_only=false)
getAmountOfOldNotifications()
Returns the sum of all old notifications values in the Standard Notifications.
getAmountOfNewNotifications()
Returns the sum of all new notifications values in the Standard Notifications.
$administrative_notifications
getItemsForUIRepresentation()
@inheritDoc
__construct(array $providers)
MetaBarMainCollector constructor.
getNotificationsIdentifiersAsArray(bool $hashed=false)
sortItemsForUIRepresentation()
returnNotificationsFromProviders()
Generator yielding the Notifications from the set of providers.
getNotifications()
Returns the set of collected informations.
returnAdministrativeNotificationsFromProviders()
cleanupItemsForUIRepresentation()
getAdministrativeNotifications()
prepareItemsForUIRepresentation()
Class StandardNotificationGroup Groups a set of Notification.
Interface NotificationProvider.