src/Entity/Tide.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TideRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClass: TideRepository::class)]
  9. class Tide
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id = null;
  15.     #[ORM\Column(type: Types::DATETIME_MUTABLE)]
  16.     private ?\DateTimeInterface $date = null;
  17.    
  18.     #[ORM\Column(type: Types::TIME_MUTABLE)]
  19.     private ?\DateTimeInterface $heureBasse = null;
  20.     #[ORM\Column(type: Types::TIME_MUTABLE)]
  21.     private ?\DateTimeInterface $heureHaute = null;
  22.     #[ORM\Column(length: 255)]
  23.     private ?string $coeff = null;
  24.     #[ORM\ManyToMany(targetEntity: Calendar::class, mappedBy: 'tides')]
  25.     protected Collection $calendars;
  26.   
  27.     public function __construct()
  28.     {
  29.         $this->activity = new ArrayCollection();
  30.         $this->calendars = new ArrayCollection();
  31.     }
  32.     
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getDate(): ?\DateTimeInterface
  38.     {
  39.         return $this->date;
  40.     }
  41.     public function setDate(\DateTimeInterface $date): static
  42.     {
  43.         $this->date = $date;
  44.         return $this;
  45.     }
  46.     public function getHeureBasse(): ?\DateTimeInterface
  47.     {
  48.         return $this->heureBasse;
  49.     }
  50.     public function setHeureBasse(\DateTimeInterface $heureBasse): static
  51.     {
  52.         $this->heureBasse = $heureBasse;
  53.         return $this;
  54.     }
  55.     public function getHeureHaute(): ?\DateTimeInterface
  56.     {
  57.         return $this->heureHaute;
  58.     }
  59.     public function setHeureHaute(\DateTimeInterface $heureHaute): static
  60.     {
  61.         $this->heureHaute = $heureHaute;
  62.         return $this;
  63.     }
  64.     public function getCoeff(): ?string
  65.     {
  66.         return $this->coeff;
  67.     }
  68.     public function setCoeff(string $coeff): static
  69.     {
  70.         $this->coeff = $coeff;
  71.         return $this;
  72.     }
  73.     /**
  74.      * @return Collection<int, Calendar>
  75.      */
  76.     public function getCalendars(): Collection
  77.     {
  78.         return $this->calendars;
  79.     }
  80.     public function addCalendar(Calendar $calendar): static
  81.     {
  82.         if (!$this->calendars->contains($calendar)) {
  83.             $this->calendars->add($calendar);
  84.             $calendar->addTide($this);
  85.         }
  86.         return $this;
  87.     }
  88.     public function removeCalendar(Calendar $calendar): static
  89.     {
  90.         if ($this->calendars->removeElement($calendar)) {
  91.             $calendar->removeTide($this);
  92.         }
  93.         return $this;
  94.     }
  95.    
  96.     
  97.     
  98.    
  99. }