src/Entity/ClosureClient.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ClosureClientRepository;
  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(repositoryClassClosureClientRepository::class)]
  9. class ClosureClient
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  16.     private ?\DateTimeInterface $startDate null;
  17.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  18.     private ?\DateTimeInterface $endDate null;
  19.     #[ORM\ManyToOne(inversedBy'closuresClient')]
  20.     #[ORM\JoinColumn(nullablefalse)]
  21.     private ?Client $client null;
  22.     #[ORM\OneToMany(mappedBy'clientClosure'targetEntitySchedules::class)]
  23.     private Collection $schedules;
  24.     public function __construct()
  25.     {
  26.         $this->schedules = new ArrayCollection();
  27.     }
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getStartDate(): ?\DateTimeInterface
  33.     {
  34.         return $this->startDate;
  35.     }
  36.     public function setStartDate(\DateTimeInterface $startDate): self
  37.     {
  38.         $this->startDate $startDate;
  39.         return $this;
  40.     }
  41.     public function getEndDate(): ?\DateTimeInterface
  42.     {
  43.         return $this->endDate;
  44.     }
  45.     public function setEndDate(\DateTimeInterface $endDate): self
  46.     {
  47.         $this->endDate $endDate;
  48.         return $this;
  49.     }
  50.     public function getClient(): ?Client
  51.     {
  52.         return $this->client;
  53.     }
  54.     public function setClient(?Client $client): self
  55.     {
  56.         $this->client $client;
  57.         return $this;
  58.     }
  59.     /**
  60.      * @return Collection<int, Schedules>
  61.      */
  62.     public function getSchedules(): Collection
  63.     {
  64.         return $this->schedules;
  65.     }
  66.     public function addSchedule(Schedules $schedule): self
  67.     {
  68.         if (!$this->schedules->contains($schedule)) {
  69.             $this->schedules->add($schedule);
  70.             $schedule->setClientClosure($this);
  71.         }
  72.         return $this;
  73.     }
  74.     public function removeSchedule(Schedules $schedule): self
  75.     {
  76.         if ($this->schedules->removeElement($schedule)) {
  77.             // set the owning side to null (unless already changed)
  78.             if ($schedule->getClientClosure() === $this) {
  79.                 $schedule->setClientClosure(null);
  80.             }
  81.         }
  82.         return $this;
  83.     }
  84. }