src/Entity/Appointment.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AppointmentRepository;
  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(repositoryClassAppointmentRepository::class)]
  9. class Appointment
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\ManyToOne(inversedBy'appointments')]
  16.     private ?AppointmentType $appointmentType null;
  17.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  18.     private ?\DateTimeInterface $date null;
  19.     #[ORM\Column]
  20.     private ?int $places null;
  21.     #[ORM\ManyToMany(targetEntityUser::class, inversedBy'appointments')]
  22.     private Collection $user;
  23.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  24.     private ?string $description null;
  25.     #[ORM\Column(nullabletrue)]
  26.     private ?int $registrants null;
  27.     #[ORM\Column(length510nullabletrue)]
  28.     private ?string $link null;
  29.     #[ORM\ManyToMany(targetEntityTraining::class, inversedBy'appointments')]
  30.     private Collection $training;
  31.     #[ORM\Column(length510nullabletrue)]
  32.     private ?string $address null;
  33.     #[ORM\ManyToOne(inversedBy'appointments')]
  34.     private ?Member $member null;
  35.     #[ORM\OneToMany(mappedBy'appointment'targetEntityAppointmentsCheck::class)]
  36.     private Collection $appointmentsChecks;
  37.     #[ORM\Column(nullabletrue)]
  38.     private ?bool $enabled null;
  39.     #[ORM\Column(nullabletrue)]
  40.     private ?bool $poursuite null;
  41.     public function __construct()
  42.     {
  43.         $this->user = new ArrayCollection();
  44.         $this->training = new ArrayCollection();
  45.         $this->appointmentsChecks = new ArrayCollection();
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getAppointmentType(): ?AppointmentType
  52.     {
  53.         return $this->appointmentType;
  54.     }
  55.     public function setAppointmentType(?AppointmentType $appointmentType): self
  56.     {
  57.         $this->appointmentType $appointmentType;
  58.         return $this;
  59.     }
  60.     public function getDate(): ?\DateTimeInterface
  61.     {
  62.         return $this->date;
  63.     }
  64.     public function setDate(\DateTimeInterface $date): self
  65.     {
  66.         $this->date $date;
  67.         return $this;
  68.     }
  69.     public function getPlaces(): ?int
  70.     {
  71.         return $this->places;
  72.     }
  73.     public function setPlaces(int $places): self
  74.     {
  75.         $this->places $places;
  76.         return $this;
  77.     }
  78.     /**
  79.      * @return Collection<int, User>
  80.      */
  81.     public function getUser(): Collection
  82.     {
  83.         return $this->user;
  84.     }
  85.     public function addUser(User $user): self
  86.     {
  87.         if (!$this->user->contains($user)) {
  88.             $this->user->add($user);
  89.         }
  90.         return $this;
  91.     }
  92.     public function removeUser(User $user): self
  93.     {
  94.         $this->user->removeElement($user);
  95.         return $this;
  96.     }
  97.     /**
  98.      * @return Collection<int, AppointmentsCheck>
  99.      */
  100.     public function getAppointmentChecks(): Collection
  101.     {
  102.         return $this->appointmentsChecks;
  103.     }
  104. //    public function addAppointmentsChecks(AppointmentsCheck $appointmentsCheck): self
  105. //    {
  106. //        if (!$this->appointmentsChecks->contains($appointmentsCheck)) {
  107. //            $this->appointmentsChecks->add($appointmentsCheck);
  108. //        }
  109. //
  110. //        return $this;
  111. //    }
  112. //
  113. //    public function removeAppointmentsChecks(AppointmentCheck $appointmentsChecks): self
  114. //    {
  115. //        $this->appointmentsChecks->removeElement($appointmentsChecks);
  116. //
  117. //        return $this;
  118. //    }
  119.     public function getDescription(): ?string
  120.     {
  121.         return $this->description;
  122.     }
  123.     public function setDescription(?string $description): self
  124.     {
  125.         $this->description $description;
  126.         return $this;
  127.     }
  128.     public function getRegistrants(): ?int
  129.     {
  130.         return $this->registrants;
  131.     }
  132.     public function setRegistrants(int $registrants): self
  133.     {
  134.         $this->registrants $registrants;
  135.         return $this;
  136.     }
  137.     public function getLink(): ?string
  138.     {
  139.         return $this->link;
  140.     }
  141.     public function setLink(?string $link): self
  142.     {
  143.         $this->link $link;
  144.         return $this;
  145.     }
  146.     /**
  147.      * @return Collection<int, Training>
  148.      */
  149.     public function getTraining(): Collection
  150.     {
  151.         return $this->training;
  152.     }
  153.     public function addTraining(Training $training): self
  154.     {
  155.         if (!$this->training->contains($training)) {
  156.             $this->training->add($training);
  157.         }
  158.         return $this;
  159.     }
  160.     public function removeTraining(Training $training): self
  161.     {
  162.         $this->training->removeElement($training);
  163.         return $this;
  164.     }
  165.     public function getAddress(): ?string
  166.     {
  167.         return $this->address;
  168.     }
  169.     public function setAddress(?string $address): self
  170.     {
  171.         $this->address $address;
  172.         return $this;
  173.     }
  174.     public function getMember(): ?Member
  175.     {
  176.         return $this->member;
  177.     }
  178.     public function setMember(?Member $member): self
  179.     {
  180.         $this->member $member;
  181.         return $this;
  182.     }
  183.     /**
  184.      * @return Collection<int, AppointmentsCheck>
  185.      */
  186.     public function getAppointmentsChecks(): Collection
  187.     {
  188.         return $this->appointmentsChecks;
  189.     }
  190.     public function addAppointmentsCheck(AppointmentsCheck $appointmentsCheck): self
  191.     {
  192.         if (!$this->appointmentsChecks->contains($appointmentsCheck)) {
  193.             $this->appointmentsChecks->add($appointmentsCheck);
  194.             $appointmentsCheck->setAppointment($this);
  195.         }
  196.         return $this;
  197.     }
  198.     public function removeAppointmentsCheck(AppointmentsCheck $appointmentsCheck): self
  199.     {
  200.         if ($this->appointmentsChecks->removeElement($appointmentsCheck)) {
  201.             // set the owning side to null (unless already changed)
  202.             if ($appointmentsCheck->getAppointment() === $this) {
  203.                 $appointmentsCheck->setAppointment(null);
  204.             }
  205.         }
  206.         return $this;
  207.     }
  208.     public function isEnabled(): ?bool
  209.     {
  210.         return $this->enabled;
  211.     }
  212.     public function setEnabled(?bool $enabled): self
  213.     {
  214.         $this->enabled $enabled;
  215.         return $this;
  216.     }
  217.     public function isPoursuite(): ?bool
  218.     {
  219.         return $this->poursuite;
  220.     }
  221.     public function setPoursuite(?bool $poursuite): self
  222.     {
  223.         $this->poursuite $poursuite;
  224.         return $this;
  225.     }
  226. }