<?phpnamespace App\Entity;use App\Repository\VacationRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=VacationRepository::class) */class Vacation extends EntityBase{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\ManyToOne(targetEntity=Poste::class, inversedBy="vacations") * @ORM\JoinColumn(nullable=false) */ private $poste; /** * @ORM\OneToMany(targetEntity=VacationLine::class, mappedBy="vacation", orphanRemoval=true,cascade={"persist"}) */ private $vacationLines; /** * @ORM\Column(type="datetime") */ private $vacationDateTime; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $currentPlace = 'draft'; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $currentPlaceCentrale; public function __construct() { $this->vacationLines = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getPoste(): ?Poste { return $this->poste; } public function setPoste(?Poste $poste): self { $this->poste = $poste; return $this; } /** * @return Collection<int, VacationLine> */ public function getVacationLines(): Collection { return $this->vacationLines; } public function addVacationLine(VacationLine $vacationLine): self { if (!$this->vacationLines->contains($vacationLine)) { $this->vacationLines[] = $vacationLine; $vacationLine->setVacation($this); } return $this; } public function removeVacationLine(VacationLine $vacationLine): self { if ($this->vacationLines->removeElement($vacationLine)) { // set the owning side to null (unless already changed) if ($vacationLine->getVacation() === $this) { $vacationLine->setVacation(null); } } return $this; } public function getVacationDateTime(): ?\DateTimeInterface { return $this->vacationDateTime; } public function setVacationDateTime(\DateTimeInterface $vacationDateTime): self { $this->vacationDateTime = $vacationDateTime; return $this; } public function getCurrentPlace(): ?string { return $this->currentPlace; } public function setCurrentPlace(?string $currentPlace): self { $this->currentPlace = $currentPlace; return $this; } public function getCurrentPlaceCentrale(): ?string { return $this->currentPlaceCentrale; } public function setCurrentPlaceCentrale(?string $currentPlaceCentrale): self { $this->currentPlaceCentrale = $currentPlaceCentrale; return $this; }}