From 49d72f1d483acc97d910da7be627961e4ee2cd7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sun, 30 Apr 2023 20:25:21 +0200 Subject: [PATCH] adapt $withRelations usage to soko-web 0.7 --- src/Controller/CommunityController.php | 4 ++-- src/Controller/HomeController.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Controller/CommunityController.php b/src/Controller/CommunityController.php index f14225e..1a853e9 100644 --- a/src/Controller/CommunityController.php +++ b/src/Controller/CommunityController.php @@ -48,7 +48,7 @@ class CommunityController implements IAuthenticationRequired return null; } - \Container::$persistentDataManager->loadRelationsFromDb($community, false); + \Container::$persistentDataManager->loadRelationsFromDb($community, false, ['main_currency']); return new HtmlContent('communities/community', [ 'community' => $community, @@ -326,7 +326,7 @@ class CommunityController implements IAuthenticationRequired private function getMembers(Community $community): array { - $members = iterator_to_array($this->communityMemberRepository->getAllByCommunity($community, true, [User::class])); + $members = iterator_to_array($this->communityMemberRepository->getAllByCommunity($community, true, ['user'])); usort($members, function($a, $b) { return strnatcmp($a->getUser()->getDisplayName(), $b->getUser()->getDisplayName()); }); diff --git a/src/Controller/HomeController.php b/src/Controller/HomeController.php index 2094852..d3a4960 100644 --- a/src/Controller/HomeController.php +++ b/src/Controller/HomeController.php @@ -28,7 +28,7 @@ class HomeController implements IAuthenticationRequired */ $user = \Container::$request->user(); - $ownCommunityMembers = $this->communityMemberRepository->getAllByUser($user, true, [Community::class]); + $ownCommunityMembers = $this->communityMemberRepository->getAllByUser($user, true, ['community']); $communities = []; foreach ($ownCommunityMembers as $ownCommunityMember) { $communities[] = $ownCommunityMember->getCommunity();