- Portage des fonctionnalités de la branche main
- Ajout de node et npm dans la Dockerfile - Ajout des Factories et Fixtures - Ajout de npm-install dans Make install
This commit is contained in:
@@ -10,7 +10,7 @@ use Random\RandomException;
|
||||
class ApiToken
|
||||
{
|
||||
|
||||
private const string PERSONAL_ACCESS_TOKEN_PREFIX = 'ipm_';
|
||||
private const string PERSONAL_ACCESS_TOKEN_PREFIX = 'mgr_';
|
||||
public const string SCOPE_USER_EDIT = 'ROLE_USER_EDIT';
|
||||
public const string SCOPE_PROJECT_CREATE = 'ROLE_PROJECT_CREATE';
|
||||
public const string SCOPE_PROJECT_EDIT = 'ROLE_PROJECT_EDIT';
|
||||
|
||||
120
src/Entity/Chapter.php
Normal file
120
src/Entity/Chapter.php
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\ChapterRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: ChapterRepository::class)]
|
||||
class Chapter
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[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;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->pagesLink = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getNumber(): ?float
|
||||
{
|
||||
return $this->number;
|
||||
}
|
||||
|
||||
public function setNumber(float $number): self
|
||||
{
|
||||
$this->number = $number;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public function setManga(?Manga $manga): self
|
||||
{
|
||||
$this->manga = $manga;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
100
src/Entity/Manga.php
Normal file
100
src/Entity/Manga.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\MangaRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: MangaRepository::class)]
|
||||
class Manga
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $title = null;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'manga', targetEntity: Chapter::class, orphanRemoval: true)]
|
||||
private Collection $chapters;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $slug = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->chapters = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getTitle(): ?string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function setTitle(string $title): self
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Chapter>
|
||||
*/
|
||||
public function getChapters(): Collection
|
||||
{
|
||||
return $this->chapters;
|
||||
}
|
||||
|
||||
public function getChapterByNumber(float $number): ?Chapter
|
||||
{
|
||||
foreach ($this->chapters as $chapter) {
|
||||
if ($chapter->getNumber() === $number) {
|
||||
return $chapter;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function addChapter(Chapter $chapter): self
|
||||
{
|
||||
if (!$this->chapters->contains($chapter)) {
|
||||
$this->chapters->add($chapter);
|
||||
$chapter->setManga($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeChapter(Chapter $chapter): self
|
||||
{
|
||||
if ($this->chapters->removeElement($chapter)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($chapter->getManga() === $this) {
|
||||
$chapter->setManga(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSlug(): ?string
|
||||
{
|
||||
return $this->slug;
|
||||
}
|
||||
|
||||
public function setSlug(string $slug): self
|
||||
{
|
||||
$this->slug = $slug;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
81
src/Entity/Page.php
Normal file
81
src/Entity/Page.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
126
src/Entity/Source.php
Normal file
126
src/Entity/Source.php
Normal file
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\SourceRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: SourceRepository::class)]
|
||||
class Source
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $name = null;
|
||||
|
||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||
private ?string $description = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $baseUrl = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private array $scrappingParameters = [];
|
||||
|
||||
#[ORM\Column]
|
||||
private ?bool $isActive = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?\DateTimeImmutable $updatedAt = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(?string $name): self
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDescription(): ?string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function setDescription(?string $description): self
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBaseUrl(): ?string
|
||||
{
|
||||
return $this->baseUrl;
|
||||
}
|
||||
|
||||
public function setBaseUrl(string $baseUrl): self
|
||||
{
|
||||
$this->baseUrl = $baseUrl;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getScrappingParameters(): array
|
||||
{
|
||||
return $this->scrappingParameters;
|
||||
}
|
||||
|
||||
public function setScrappingParameters(?array $scrappingParameters): self
|
||||
{
|
||||
$this->scrappingParameters = $scrappingParameters;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isIsActive(): ?bool
|
||||
{
|
||||
return $this->isActive;
|
||||
}
|
||||
|
||||
public function setIsActive(bool $isActive): self
|
||||
{
|
||||
$this->isActive = $isActive;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
public function setCreatedAt(\DateTimeImmutable $createdAt): self
|
||||
{
|
||||
$this->createdAt = $createdAt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUpdatedAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
||||
public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
|
||||
{
|
||||
$this->updatedAt = $updatedAt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user