MAPG-235 queries with relations on any recursion level implemented

This commit is contained in:
balazs committed 2021-05-15 11:43:00 +02:00
1 parent 21e41b7c36
commit 44df94eb98
6 files changed
+102 -26

No files matched your search

@@ -41,6 +41,17 @@ class UserInChallengeRepository
return $this->pdm->selectFromDb($select, UserInChallenge::class);
}
public function getByUserIdAndToken(int $userId, string $token_str): ?UserInChallenge
{
$token = hexdec($token_str);
$select = new Select(\Container::$dbConnection);
$select->where('user_id', '=', $userId);
$select->where('token', '=', $token);
return $this->pdm->selectFromDb($select, UserInChallenge::class, true);
}
public function isUserParticipatingInChallenge(int $userId, Challenge $challenge): bool
{
$select = new Select(\Container::$dbConnection, 'user_in_challenge');