RVRNEXT-11 add upcoming events for user
This commit is contained in:
2 files changed
+13
-2
No files matched your search
@@ -1,8 +1,10 @@
|
||||
<?php namespace RVR\Controller;
|
||||
|
||||
use DateTime;
|
||||
use RVR\PersistentData\Model\Community;
|
||||
use RVR\PersistentData\Model\User;
|
||||
use RVR\Repository\CommunityMemberRepository;
|
||||
use RVR\Repository\EventRepository;
|
||||
use SokoWeb\Interfaces\Authentication\IAuthenticationRequired;
|
||||
use SokoWeb\Interfaces\Response\IContent;
|
||||
use SokoWeb\Response\HtmlContent;
|
||||
@@ -11,9 +13,12 @@ class HomeController implements IAuthenticationRequired
|
||||
{
|
||||
private CommunityMemberRepository $communityMemberRepository;
|
||||
|
||||
private EventRepository $eventRepository;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->communityMemberRepository = new CommunityMemberRepository();
|
||||
$this->eventRepository = new EventRepository();
|
||||
}
|
||||
|
||||
public function isAuthenticationRequired(): bool
|
||||
@@ -39,7 +44,7 @@ class HomeController implements IAuthenticationRequired
|
||||
|
||||
return new HtmlContent('home', [
|
||||
'communities' => $communities,
|
||||
'upcomingEvents' => []
|
||||
'upcomingEvents' => iterator_to_array($this->eventRepository->getUpcomingByUser($user, new DateTime(), 3, true, ['community']))
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user