Switch data source from notify to notification in Module\Notifications\Ping

- Change unused FormattedNotification classes to FormattedNavNotification classes
This commit is contained in:
Hypolite Petovan
2022-03-05 15:34:09 -05:00
parent 1ae7cac236
commit 49971b1465
7 changed files with 299 additions and 627 deletions

View File

@@ -47,4 +47,11 @@ class Notifications extends BaseCollection
$Notification->setDismissed();
});
}
public function countUnseen(): int
{
return array_reduce($this->getArrayCopy(), function (int $carry, Entity\Notification $Notification) {
return $carry + ($Notification->seen ? 0 : 1);
}, 0);
}
}