コード例 #1
0
 public function leaveCommunity(int $profileId, string $communitySID)
 {
     $communityId = $this->communityRepository->getCommunityBySID($communitySID)->getId();
     if (!$this->hasBookmarks($profileId, $communityId)) {
         throw new AlreadyLeavedException(sprintf('You are not joined to this community'));
     }
     $this->profileCommunitiesRepository->leaveCommunity($profileId, $communityId);
 }
コード例 #2
0
 public function getCommunityBySID(string $communitySID) : Community
 {
     return $this->communityRepository->getCommunityBySID($communitySID);
 }