<?phpnamespace App\Entity;use App\Entity\Special\VotingInfo;use App\Repository\CuttingScheduleRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=CuttingScheduleRepository::class) */class CuttingSchedule{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $hour; /** * @ORM\OneToMany(targetEntity=Person::class, mappedBy="cuttingSchedule") */ private $persons; /** * @ORM\OneToMany(targetEntity=VotingInfo::class, mappedBy="CuttingSchedule") */ private $votingInfos; public function __construct() { $this->persons = new ArrayCollection(); $this->votingInfos = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getHour(): ?string { return $this->hour; } public function setHour(string $hour): self { $this->hour = $hour; return $this; } /** * @return Collection<int, Person> */ public function getPersons(): Collection { return $this->persons; } public function addPerson(Person $person): self { if (!$this->persons->contains($person)) { $this->persons[] = $person; $person->setCuttingSchedule($this); } return $this; } public function removePerson(Person $person): self { if ($this->persons->removeElement($person)) { // set the owning side to null (unless already changed) if ($person->getCuttingSchedule() === $this) { $person->setCuttingSchedule(null); } } return $this; } /** * @return Collection<int, VotingInfo> */ public function getVotingInfos(): Collection { return $this->votingInfos; } public function addVotingInfo(VotingInfo $votingInfo): self { if (!$this->votingInfos->contains($votingInfo)) { $this->votingInfos[] = $votingInfo; $votingInfo->setCuttingSchedule($this); } return $this; } public function removeVotingInfo(VotingInfo $votingInfo): self { if ($this->votingInfos->removeElement($votingInfo)) { // set the owning side to null (unless already changed) if ($votingInfo->getCuttingSchedule() === $this) { $votingInfo->setCuttingSchedule(null); } } return $this; }}