public function format(Profile $profile) : array { return ['profile' => $profile->toJSON(), 'collections' => $this->formatCollections($profile->getCollections()), 'bookmarks' => array_map(function (ProfileCommunityEQ $eq) { return $eq->toJSON(); }, $this->communityBookmarksService->getBookmarksOfProfile($profile->getId())), 'is_own' => $this->currentAccountService->isAvailable() ? $this->currentAccountService->getCurrentAccount()->getProfiles()->contains($profile) : false]; }
public function up(EventEmitterInterface $globalEmitter) { $this->communityService->getEventEmitter()->on(CommunityService::EVENT_COMMUNITY_CREATED, function (Community $community) { $this->profileCommunitiesService->joinToCommunity($community->getOwner()->getCurrentProfile()->getId(), $community->getSID()); }); }