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); }
public function getCommunityBySID(string $communitySID) : Community { return $this->communityRepository->getCommunityBySID($communitySID); }