private function generateProfileImage(int $profileId) : ImageCollection { $profile = $this->getProfileById($profileId); $strategy = new ProfileImageStrategy($profile, $this->imagesFlySystem, $this->wwwImagesDir); $this->avatarService->generateImage($strategy); $this->profileRepository->saveProfile($profile); return $profile->getImages(); }
public function generateImage(int $collectionId) : ImageCollection { $collection = $this->collectionRepository->getCollectionById($collectionId); $this->getEventEmitter()->emit(self::EVENT_COLLECTION_ACCESS, [$collection]); $this->avatarService->generateImage(new CollectionImageStrategy($collection, $this->images, $this->wwwImagesDir)); $this->collectionRepository->saveCollection($collection); $this->getEventEmitter()->emit(self::EVENT_COLLECTION_IMAGE_GENERATED, [$collection]); return $collection->getImages(); }
public function generateCommunityImage(int $communityId) : ImageCollection { $community = $this->communityRepository->getCommunityById($communityId); $strategy = new CommunityImageStrategy($community, $this->imageFileSystem, $this->wwwImageDir); $this->avatarService->defaultImage($strategy); $this->communityRepository->saveCommunity($community); $this->getEventEmitter()->emit(self::EVENT_COMMUNITY_UPDATED, [$community]); return $community->getImages(); }