/** * @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); }
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); }
public function findOneById(UuidInterface $id) { return $this->tagRepository->findOneById($id); }