示例#1
0
 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();
 }
示例#2
0
 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();
 }
示例#3
0
 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();
 }