chapters = new ArrayCollection(); $this->createdAt = new \DateTimeImmutable(); } 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 */ 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; } 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; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->createdAt; } public function setCreatedAt(\DateTimeImmutable $createdAt): static { $this->createdAt = $createdAt; return $this; } public function getRating(): ?float { return $this->rating; } public function setRating(?float $rating): static { $this->rating = $rating; return $this; } public function getAuthor(): ?string { return $this->author; } public function setAuthor(?string $author): static { $this->author = $author; return $this; } public function getExternalId(): ?string { return $this->externalId; } public function setExternalId(?string $externalId): static { $this->externalId = $externalId; return $this; } public function getStatus(): ?string { return $this->status; } public function setStatus(?string $status): static { $this->status = $status; return $this; } public function getThumbnailUrl(): ?string { return $this->thumbnailUrl; } public function setThumbnailUrl(?string $thumbnailUrl): static { $this->thumbnailUrl = $thumbnailUrl; return $this; } }