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