Added:
- settings form - manga upload directory - ContentSource export/import
This commit is contained in:
50
src/Entity/AppSettings.php
Normal file
50
src/Entity/AppSettings.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\AppSettingsRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: AppSettingsRepository::class)]
|
||||
class AppSettings
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $MangaDirectory = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $ImageDirectory = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getMangaDirectory(): ?string
|
||||
{
|
||||
return $this->MangaDirectory;
|
||||
}
|
||||
|
||||
public function setMangaDirectory(?string $MangaDirectory): static
|
||||
{
|
||||
$this->MangaDirectory = $MangaDirectory;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getImageDirectory(): ?string
|
||||
{
|
||||
return $this->ImageDirectory;
|
||||
}
|
||||
|
||||
public function setImageDirectory(?string $ImageDirectory): static
|
||||
{
|
||||
$this->ImageDirectory = $ImageDirectory;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -20,16 +20,10 @@ class Chapter
|
||||
#[ORM\Column]
|
||||
private ?float $number = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private array $pages = [];
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'chapters')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Manga $manga = null;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'chapter', targetEntity: Page::class, orphanRemoval: true)]
|
||||
private Collection $pagesLink;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $volume = null;
|
||||
|
||||
@@ -45,12 +39,11 @@ class Chapter
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $cbzPath = null;
|
||||
|
||||
#[ORM\Column]
|
||||
#[ORM\Column(type: 'boolean', options: ['default' => true])]
|
||||
private ?bool $visible = true;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->pagesLink = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
@@ -70,18 +63,6 @@ class Chapter
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPages(): array
|
||||
{
|
||||
return $this->pages;
|
||||
}
|
||||
|
||||
public function setPages(array $pages): self
|
||||
{
|
||||
$this->pages = $pages;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getManga(): ?Manga
|
||||
{
|
||||
return $this->manga;
|
||||
@@ -94,50 +75,6 @@ class Chapter
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Page>
|
||||
*/
|
||||
public function getPagesLink(): Collection
|
||||
{
|
||||
return $this->pagesLink;
|
||||
}
|
||||
|
||||
public function addPagesLink(Page $pagesLink): self
|
||||
{
|
||||
if (!$this->pagesLink->contains($pagesLink)) {
|
||||
$this->pagesLink->add($pagesLink);
|
||||
$pagesLink->setChapter($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removePagesLink(Page $pagesLink): self
|
||||
{
|
||||
if ($this->pagesLink->removeElement($pagesLink)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($pagesLink->getChapter() === $this) {
|
||||
$pagesLink->setChapter(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPageByNumber(int $number): ?Page
|
||||
{
|
||||
/**
|
||||
* @var Page $page
|
||||
*/
|
||||
foreach ($this->pagesLink as $page) {
|
||||
if ($page->getNumber() === $number) {
|
||||
return $page;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getVolume(): ?int
|
||||
{
|
||||
return $this->volume;
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\PageRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: PageRepository::class)]
|
||||
class Page
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?int $number = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $imageUrl = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'pagesLink')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Chapter $chapter = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $imageLocalUrl = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getNumber(): ?int
|
||||
{
|
||||
return $this->number;
|
||||
}
|
||||
|
||||
public function setNumber(int $number): self
|
||||
{
|
||||
$this->number = $number;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getImageUrl(): ?string
|
||||
{
|
||||
return $this->imageUrl;
|
||||
}
|
||||
|
||||
public function setImageUrl(string $imageUrl): self
|
||||
{
|
||||
$this->imageUrl = $imageUrl;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getChapter(): ?Chapter
|
||||
{
|
||||
return $this->chapter;
|
||||
}
|
||||
|
||||
public function setChapter(?Chapter $chapter): self
|
||||
{
|
||||
$this->chapter = $chapter;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getImageLocalUrl(): ?string
|
||||
{
|
||||
return $this->imageLocalUrl;
|
||||
}
|
||||
|
||||
public function setImageLocalUrl(string $imageLocalUrl): self
|
||||
{
|
||||
$this->imageLocalUrl = $imageLocalUrl;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user