communityMemberRepository = new CommunityMemberRepository(); } public function isAuthenticationRequired(): bool { return true; } public function getHome(): IContent { /** * @var User $user */ $user = \Container::$request->user(); $ownCommunityMembers = $this->communityMemberRepository->getAllByUser($user, true); $communities = []; foreach ($ownCommunityMembers as $ownCommunityMember) { $communities[] = $ownCommunityMember->getCommunity(); } usort($communities, function($a, $b) { return strnatcmp($a->getName(), $b->getName()); }); return new HtmlContent('home', [ 'communities' => $communities, 'upcomingEvents' => [] ]); } }