- début refonte graphique
- début MangaDbProvider
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Entity;
|
||||
use App\Repository\MangaRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: MangaRepository::class)]
|
||||
@@ -24,6 +25,18 @@ class Manga
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $slug = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $imageUrl = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $publicationYear = null;
|
||||
|
||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||
private ?string $description = null;
|
||||
|
||||
#[ORM\Column(type: Types::ARRAY, nullable: true)]
|
||||
private ?array $genres = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->chapters = new ArrayCollection();
|
||||
@@ -55,14 +68,14 @@ class Manga
|
||||
}
|
||||
|
||||
public function getChapterByNumber(float $number): ?Chapter
|
||||
{
|
||||
foreach ($this->chapters as $chapter) {
|
||||
if ($chapter->getNumber() === $number) {
|
||||
return $chapter;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
{
|
||||
foreach ($this->chapters as $chapter) {
|
||||
if ($chapter->getNumber() === $number) {
|
||||
return $chapter;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function addChapter(Chapter $chapter): self
|
||||
{
|
||||
@@ -97,4 +110,52 @@ class Manga
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getImageUrl(): ?string
|
||||
{
|
||||
return $this->imageUrl;
|
||||
}
|
||||
|
||||
public function setImageUrl(?string $imageUrl): static
|
||||
{
|
||||
$this->imageUrl = $imageUrl;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPublicationYear(): ?int
|
||||
{
|
||||
return $this->publicationYear;
|
||||
}
|
||||
|
||||
public function setPublicationYear(?int $publicationYear): static
|
||||
{
|
||||
$this->publicationYear = $publicationYear;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDescription(): ?string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function setDescription(?string $description): static
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGenres(): ?array
|
||||
{
|
||||
return $this->genres;
|
||||
}
|
||||
|
||||
public function setGenres(?array $genres): static
|
||||
{
|
||||
$this->genres = $genres;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user