Esempio n. 1
0
 /**
  * @param UuidInterface $productId
  * @param UuidInterface $tagId
  * @throws EntityNotFoundException
  */
 public function removeTag(UuidInterface $productId, UuidInterface $tagId)
 {
     $product = $this->productRepository->findOneById($productId);
     $tag = $this->tagRepository->findOneById($tagId);
     $product->removeTag($tag);
     $this->productRepository->update($product);
 }
Esempio n. 2
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);
 }
Esempio n. 3
0
 public function findOneById(UuidInterface $id)
 {
     return $this->tagRepository->findOneById($id);
 }