src/Entity/Vacation.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\VacationRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=VacationRepository::class)
  9.  */
  10. class Vacation  extends EntityBase
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=Poste::class, inversedBy="vacations")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $poste;
  23.     /**
  24.      * @ORM\OneToMany(targetEntity=VacationLine::class, mappedBy="vacation", orphanRemoval=true,cascade={"persist"})
  25.      */
  26.     private $vacationLines;
  27.     /**
  28.      * @ORM\Column(type="datetime")
  29.      */
  30.     private $vacationDateTime;
  31.     /**
  32.      * @ORM\Column(type="string", length=255, nullable=true)
  33.      */
  34.     private $currentPlace 'draft';
  35.     /**
  36.      * @ORM\Column(type="string", length=255, nullable=true)
  37.      */
  38.     private $currentPlaceCentrale;
  39.     public function __construct()
  40.     {
  41.         $this->vacationLines = new ArrayCollection();
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getPoste(): ?Poste
  48.     {
  49.         return $this->poste;
  50.     }
  51.     public function setPoste(?Poste $poste): self
  52.     {
  53.         $this->poste $poste;
  54.         return $this;
  55.     }
  56.     /**
  57.      * @return Collection<int, VacationLine>
  58.      */
  59.     public function getVacationLines(): Collection
  60.     {
  61.         return $this->vacationLines;
  62.     }
  63.     public function addVacationLine(VacationLine $vacationLine): self
  64.     {
  65.         if (!$this->vacationLines->contains($vacationLine)) {
  66.             $this->vacationLines[] = $vacationLine;
  67.             $vacationLine->setVacation($this);
  68.         }
  69.         return $this;
  70.     }
  71.     public function removeVacationLine(VacationLine $vacationLine): self
  72.     {
  73.         if ($this->vacationLines->removeElement($vacationLine)) {
  74.             // set the owning side to null (unless already changed)
  75.             if ($vacationLine->getVacation() === $this) {
  76.                 $vacationLine->setVacation(null);
  77.             }
  78.         }
  79.         return $this;
  80.     }
  81.     public function getVacationDateTime(): ?\DateTimeInterface
  82.     {
  83.         return $this->vacationDateTime;
  84.     }
  85.     public function setVacationDateTime(\DateTimeInterface $vacationDateTime): self
  86.     {
  87.         $this->vacationDateTime $vacationDateTime;
  88.         return $this;
  89.     }
  90.     public function getCurrentPlace(): ?string
  91.     {
  92.         return $this->currentPlace;
  93.     }
  94.     public function setCurrentPlace(?string $currentPlace): self
  95.     {
  96.         $this->currentPlace $currentPlace;
  97.         return $this;
  98.     }
  99.     public function getCurrentPlaceCentrale(): ?string
  100.     {
  101.         return $this->currentPlaceCentrale;
  102.     }
  103.     public function setCurrentPlaceCentrale(?string $currentPlaceCentrale): self
  104.     {
  105.         $this->currentPlaceCentrale $currentPlaceCentrale;
  106.         return $this;
  107.     }
  108. }