Added navbar and button to skip automatic search of book info online.

This commit is contained in:
krzysiej
2022-06-02 15:18:40 +02:00
parent e5562cddb1
commit b21d213b19
7 changed files with 82 additions and 35 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Service;
use App\Entity\Book;
use App\Entity\File;
use App\Repository\FileRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\File\UploadedFile;
@@ -23,11 +24,15 @@ class FileService
}
/**
* @param Collection $files
* @param Collection|File $files
* @return void
*/
public function removeFiles(Collection $files)
public function removeFiles(Collection|File $files)
{
if (!$files instanceof Collection) {
$files = new ArrayCollection([$files]);
}
foreach ($files as $file) {
$this->fileSystem->remove($this->getFilePath($file));
}