- trop de trucs d'un coup... je vais faire attention ensuite ^^'
This commit is contained in:
@@ -28,6 +28,15 @@ class Chapter
|
||||
#[ORM\OneToMany(mappedBy: 'chapter', targetEntity: Page::class, orphanRemoval: true)]
|
||||
private Collection $pagesLink;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $volume = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $title = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $localPath = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->pagesLink = new ArrayCollection();
|
||||
@@ -105,16 +114,52 @@ class Chapter
|
||||
}
|
||||
|
||||
public function getPageByNumber(int $number): ?Page
|
||||
{
|
||||
/**
|
||||
* @var Page $page
|
||||
*/
|
||||
foreach ($this->pagesLink as $page) {
|
||||
if ($page->getNumber() === $number) {
|
||||
return $page;
|
||||
}
|
||||
}
|
||||
{
|
||||
/**
|
||||
* @var Page $page
|
||||
*/
|
||||
foreach ($this->pagesLink as $page) {
|
||||
if ($page->getNumber() === $number) {
|
||||
return $page;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
public function getVolume(): ?int
|
||||
{
|
||||
return $this->volume;
|
||||
}
|
||||
|
||||
public function setVolume(?int $volume): static
|
||||
{
|
||||
$this->volume = $volume;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTitle(): ?string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function setTitle(?string $title): static
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLocalPath(): ?string
|
||||
{
|
||||
return $this->localPath;
|
||||
}
|
||||
|
||||
public function setLocalPath(?string $localPath): static
|
||||
{
|
||||
$this->localPath = $localPath;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user