<?phpnamespace App\Entity;use App\Repository\TideRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: TideRepository::class)]class Tide{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(type: Types::DATETIME_MUTABLE)] private ?\DateTimeInterface $date = null; #[ORM\Column(type: Types::TIME_MUTABLE)] private ?\DateTimeInterface $heureBasse = null; #[ORM\Column(type: Types::TIME_MUTABLE)] private ?\DateTimeInterface $heureHaute = null; #[ORM\Column(length: 255)] private ?string $coeff = null; #[ORM\ManyToMany(targetEntity: Calendar::class, mappedBy: 'tides')] protected Collection $calendars; public function __construct() { $this->activity = new ArrayCollection(); $this->calendars = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getDate(): ?\DateTimeInterface { return $this->date; } public function setDate(\DateTimeInterface $date): static { $this->date = $date; return $this; } public function getHeureBasse(): ?\DateTimeInterface { return $this->heureBasse; } public function setHeureBasse(\DateTimeInterface $heureBasse): static { $this->heureBasse = $heureBasse; return $this; } public function getHeureHaute(): ?\DateTimeInterface { return $this->heureHaute; } public function setHeureHaute(\DateTimeInterface $heureHaute): static { $this->heureHaute = $heureHaute; return $this; } public function getCoeff(): ?string { return $this->coeff; } public function setCoeff(string $coeff): static { $this->coeff = $coeff; return $this; } /** * @return Collection<int, Calendar> */ public function getCalendars(): Collection { return $this->calendars; } public function addCalendar(Calendar $calendar): static { if (!$this->calendars->contains($calendar)) { $this->calendars->add($calendar); $calendar->addTide($this); } return $this; } public function removeCalendar(Calendar $calendar): static { if ($this->calendars->removeElement($calendar)) { $calendar->removeTide($this); } return $this; } }