votes = 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; } public function getCreationDate(): ?\DateTimeInterface { return $this->creationDate; } public function setCreationDate( \DateTimeInterface $creationDate ): self { $this->creationDate = $creationDate; return $this; } public function getExpiracyDate(): ?\DateTimeInterface { return $this->expiracyDate; } public function setExpiracyDate( \DateTimeInterface $expiracyDate ): self { $this->expiracyDate = $expiracyDate; return $this; } public function getOwner(): ?Owner { return $this->owner; } public function setOwner( ?Owner $owner ): self { $this->owner = $owner; return $this; } /** * @return Collection|Vote[] */ public function getVotes(): Collection { return $this->votes; } public function addVote(Vote $vote): self { if (!$this->votes->contains($vote)) { $this->votes[] = $vote; $vote->setPoll($this); } return $this; } public function removeVote(Vote $vote): self { if ($this->votes->contains($vote)) { $this->votes->removeElement($vote); // set the owning side to null (unless already changed) if ($vote->getPoll() === $this) { $vote->setPoll(null); } } return $this; } }