create endpoints to get current event and current event new transaction
rvr-nextgen/pipeline/pr-master This commit looks good

This commit is contained in:
bence committed 2023-07-24 02:00:59 +02:00
1 parent b6da70e015
commit 7beec510a1
4 files changed
+93

No files matched your search

+10
View File
@@ -53,6 +53,16 @@ class EventRepository
yield from Container::$persistentDataManager->selectMultipleFromDb($select, Event::class, $useRelations, $withRelations);
}
public function getCurrentByUser(User $user, DateTime $from, int $days, bool $useRelations = false, array $withRelations = []): ?Event
{
$select = $this->selectAllByUser($user);
$this->selectUpcomingAndRecent($select, $from, $days);
$select->orderBy('start', 'DESC');
$select->limit(1, 0);
return Container::$persistentDataManager->selectFromDb($select, Event::class, $useRelations, $withRelations);
}
public function getPagedByCommunity(Community $community, int $page, int $itemsPerPage, bool $useRelations = false, array $withRelations = []): Generator
{
$select = $this->selectAllByCommunity($community);