*/ #[ORM\OneToMany(targetEntity: Comment::class, mappedBy: 'conference', orphanRemoval: true)] private Collection $comments; #[ORM\Column(length: 255, unique: true)] private ?string $slug = null; public function __construct() { $this->comments = new ArrayCollection(); } public function __toString(): string { return $this->city.' '.$this->year; } public function getId(): ?int { return $this->id; } public function computeSlug(SluggerInterface $slugger) { if (!$this->slug || '-' === $this->slug) { $this->slug = (string) $slugger->slug((string) $this)->lower(); } } public function getCity(): ?string { return $this->city; } public function setCity(string $city): static { $this->city = $city; return $this; } public function getYear(): ?string { return $this->year; } public function setYear(string $year): static { $this->year = $year; return $this; } public function isInternational(): ?bool { return $this->isInternational; } public function setIsInternational(bool $isInternational): static { $this->isInternational = $isInternational; return $this; } /** * @return Collection */ public function getComments(): Collection { return $this->comments; } public function addComment(Comment $comment): static { if (!$this->comments->contains($comment)) { $this->comments->add($comment); $comment->setConference($this); } return $this; } public function removeComment(Comment $comment): static { if ($this->comments->removeElement($comment)) { // set the owning side to null (unless already changed) if ($comment->getConference() === $this) { $comment->setConference(null); } } return $this; } public function getSlug(): ?string { return $this->slug; } public function setSlug(string $slug): static { $this->slug = $slug; return $this; } }