<?phpnamespace App\Entity;use App\Repository\ClosureClientRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ClosureClientRepository::class)]class ClosureClient{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(type: Types::DATE_MUTABLE)] private ?\DateTimeInterface $startDate = null; #[ORM\Column(type: Types::DATE_MUTABLE)] private ?\DateTimeInterface $endDate = null; #[ORM\ManyToOne(inversedBy: 'closuresClient')] #[ORM\JoinColumn(nullable: false)] private ?Client $client = null; #[ORM\OneToMany(mappedBy: 'clientClosure', targetEntity: Schedules::class)] private Collection $schedules; public function __construct() { $this->schedules = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getStartDate(): ?\DateTimeInterface { return $this->startDate; } public function setStartDate(\DateTimeInterface $startDate): self { $this->startDate = $startDate; return $this; } public function getEndDate(): ?\DateTimeInterface { return $this->endDate; } public function setEndDate(\DateTimeInterface $endDate): self { $this->endDate = $endDate; return $this; } public function getClient(): ?Client { return $this->client; } public function setClient(?Client $client): self { $this->client = $client; return $this; } /** * @return Collection<int, Schedules> */ public function getSchedules(): Collection { return $this->schedules; } public function addSchedule(Schedules $schedule): self { if (!$this->schedules->contains($schedule)) { $this->schedules->add($schedule); $schedule->setClientClosure($this); } return $this; } public function removeSchedule(Schedules $schedule): self { if ($this->schedules->removeElement($schedule)) { // set the owning side to null (unless already changed) if ($schedule->getClientClosure() === $this) { $schedule->setClientClosure(null); } } return $this; }}