$maxGuestCount = 0;
}
+ $unknownAuthor = UserProfile::getGuestUserProfile('Unknown Author');
+
$events = [];
foreach (LanguageFactory::getInstance()->getLanguages() as $language) {
for ($authorCount = $minAuthorCount; $authorCount <= $maxAuthorCount; $authorCount++) {
'language' => $language,
'timesTriggered' => $authorCount
]));
+
$event->setObject(
$this->getUserNotification($firstAuthor, $authorCount, $guestCount, $additionalData),
$object,
- $firstAuthor,
+ $authorCount ? $firstAuthor : $unknownAuthor,
$additionalData
);
- $event->setAuthors(array_slice($authors, 0, $authorCount, true));
+
+ if ($authorCount) {
+ $event->setAuthors(array_slice($authors, 0, $authorCount, true));
+ }
+ else {
+ $event->setAuthors([$unknownAuthor]);
+ }
$events[] = $event;
}