From 157f530ad5085d8f77237371768f56813478f89c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Fri, 28 Apr 2023 20:59:14 +0200 Subject: [PATCH] RVRNEXT-5 add withRelations to CommunityMemberRepository getters --- src/Repository/CommunityMemberRepository.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Repository/CommunityMemberRepository.php b/src/Repository/CommunityMemberRepository.php index b15b8ff..d0a1e2f 100644 --- a/src/Repository/CommunityMemberRepository.php +++ b/src/Repository/CommunityMemberRepository.php @@ -13,20 +13,20 @@ class CommunityMemberRepository 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->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->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