feature/RVRNEXT-5-main-currency-of-community-should-be-a-general-currency #34

Merged
bence merged 5 commits from feature/RVRNEXT-5-main-currency-of-community-should-be-a-general-currency into master 2023-04-28 21:44:19 +02:00
Showing only changes of commit 157f530ad5 - Show all commits

View File

@ -13,20 +13,20 @@ class CommunityMemberRepository
return \Container::$persistentDataManager->selectFromDbById($id, CommunityMember::class); return \Container::$persistentDataManager->selectFromDbById($id, CommunityMember::class);
} }
public function getAllByCommunity(Community $community, bool $useRelations = false): Generator public function getAllByCommunity(Community $community, bool $useRelations = false, array $withRelations = []): Generator
{ {
$select = new Select(\Container::$dbConnection); $select = new Select(\Container::$dbConnection);
$select->where('community_id', '=', $community->getId()); $select->where('community_id', '=', $community->getId());
yield from \Container::$persistentDataManager->selectMultipleFromDb($select, CommunityMember::class, $useRelations); yield from \Container::$persistentDataManager->selectMultipleFromDb($select, CommunityMember::class, $useRelations, $withRelations);
} }
public function getAllByUser(User $user, bool $useRelations = false): Generator public function getAllByUser(User $user, bool $useRelations = false, array $withRelations = []): Generator
{ {
$select = new Select(\Container::$dbConnection); $select = new Select(\Container::$dbConnection);
$select->where('user_id', '=', $user->getId()); $select->where('user_id', '=', $user->getId());
yield from \Container::$persistentDataManager->selectMultipleFromDb($select, CommunityMember::class, $useRelations); yield from \Container::$persistentDataManager->selectMultipleFromDb($select, CommunityMember::class, $useRelations, $withRelations);
} }
public function getByCommunityAndUser(Community $community, User $user) : ?CommunityMember public function getByCommunityAndUser(Community $community, User $user) : ?CommunityMember