Exemplo n.º 1
0
 public function createImageForTag(UploadFileDTO $uploadFileDTO, UuidInterface $tagId)
 {
     $managedFile = $this->fileManager->saveFile($uploadFileDTO->getFilePath());
     $image = new Image();
     $image->setPath($managedFile->getUri());
     $image->setWidth($managedFile->getWidth());
     $image->setHeight($managedFile->getHeight());
     $tag = $this->tagRepository->findOneById($tagId);
     $tag->addImage($image);
     $this->create($image);
 }
Exemplo n.º 2
0
 /**
  * @param UploadFileDTO $uploadFileDTO
  * @return Attachment
  */
 private function createAttachment(UploadFileDTO $uploadFileDTO)
 {
     $managedFile = $this->fileManager->saveFile($uploadFileDTO->getFilePath());
     $attachment = new Attachment($managedFile->getUri());
     $this->attachmentRepository->create($attachment);
     return $attachment;
 }