Exemplo n.º 1
0
 /**
  * @param Recipe $recipe
  * @throws RecipeNotFoundException
  */
 public function remove(Recipe $recipe)
 {
     if (!$this->hasRecipeWithName($recipe->getName())) {
         throw new RecipeNotFoundException(sprintf("Recipe \"%s\" does not exists", (string) $recipe->getName()));
     }
     $this->filesystem->remove(DIRECTORY_SEPARATOR . $this->slugGenerator->generateFrom((string) $recipe->getName()));
 }
Exemplo n.º 2
0
 /**
  * @param $slug
  */
 public function removeImageFor($slug)
 {
     $path = $this->generateBasePath($slug);
     $filePath = $this->composeJpgFilePath($slug, $path);
     $this->filesystem->remove($filePath);
 }