<?php
namespace App\Entity\Gos;
use App\Repository\Gos\CancellationPollRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CancellationPollRepository::class)
*/
class CancellationPoll
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\OneToMany(targetEntity=CancellationQuestion::class, mappedBy="cancellationPoll")
*/
private $cancellationQuestions;
public function __construct()
{
$this->cancellationQuestions = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
/**
* @return Collection|CancellationQuestion[]
*/
public function getCancellationQuestions(): Collection
{
return $this->cancellationQuestions;
}
public function addCancellationQuestion(CancellationQuestion $cancellationQuestion): self
{
if (!$this->cancellationQuestions->contains($cancellationQuestion)) {
$this->cancellationQuestions[] = $cancellationQuestion;
$cancellationQuestion->setCancellationPoll($this);
}
return $this;
}
public function removeCancellationQuestion(CancellationQuestion $cancellationQuestion): self
{
if ($this->cancellationQuestions->contains($cancellationQuestion)) {
$this->cancellationQuestions->removeElement($cancellationQuestion);
// set the owning side to null (unless already changed)
if ($cancellationQuestion->getCancellationPoll() === $this) {
$cancellationQuestion->setCancellationPoll(null);
}
}
return $this;
}
}