src/Entity/Training.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TrainingRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection as A;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassTrainingRepository::class)]
  9. class Training
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length1024nullabletrue)]
  16.     private ?string $name null;
  17.     #[ORM\Column]
  18.     private ?bool $enabled null;
  19.     #[ORM\Column(typeTypes::SMALLINTnullabletrue)]
  20.     private ?int $month null;
  21.     #[ORM\Column(nullabletrue)]
  22.     private ?int $ypareo null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $completeName null;
  25.     #[ORM\Column]
  26.     private ?bool $parcourssup null;
  27.     #[ORM\OneToMany(mappedBy'training'targetEntityUser::class)]
  28.     private A $users;
  29.     #[ORM\ManyToMany(targetEntityMCQType::class, mappedBy'trainings')]
  30.     private A $mCQTypes;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $level null;
  33.     #[ORM\ManyToMany(targetEntityOffer::class, mappedBy'training')]
  34.     private A $offers;
  35.     #[ORM\ManyToMany(targetEntityAppointment::class, mappedBy'training')]
  36.     private A $appointments;
  37.     #[ORM\Column(length255nullabletrue)]
  38.     private ?string $levelName null;
  39.     #[ORM\OneToMany(mappedBy'training'targetEntityTrainingGroupAF::class)]
  40.     private A $trainingGroupAFs;
  41.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  42.     private \DateTimeInterface|null $closing_date null;
  43.     public function __construct()
  44.     {
  45.         $this->users = new ArrayCollection();
  46.         $this->mCQTypes = new ArrayCollection();
  47.         $this->offers = new ArrayCollection();
  48.         $this->appointments = new ArrayCollection();
  49.         $this->trainingGroupAFs = new ArrayCollection();
  50.     }
  51.     public function getId(): ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getName(): ?string
  56.     {
  57.         return $this->name;
  58.     }
  59.     public function setName(string $name): self
  60.     {
  61.         $this->name $name;
  62.         return $this;
  63.     }
  64.     public function isEnabled(): ?bool
  65.     {
  66.         return $this->enabled;
  67.     }
  68.     public function setEnabled(bool $enabled): self
  69.     {
  70.         $this->enabled $enabled;
  71.         return $this;
  72.     }
  73.     public function getMonth(): ?int
  74.     {
  75.         return $this->month;
  76.     }
  77.     public function setMonth(int $month): self
  78.     {
  79.         $this->month $month;
  80.         return $this;
  81.     }
  82.     public function getYpareo(): ?int
  83.     {
  84.         return $this->ypareo;
  85.     }
  86.     public function setYpareo(int $ypareo): self
  87.     {
  88.         $this->ypareo $ypareo;
  89.         return $this;
  90.     }
  91.     public function getCompleteName(): ?string
  92.     {
  93.         return $this->completeName;
  94.     }
  95.     public function setCompleteName(?string $completeName): self
  96.     {
  97.         $this->completeName $completeName;
  98.         return $this;
  99.     }
  100.     public function isParcourssup(): ?bool
  101.     {
  102.         return $this->parcourssup;
  103.     }
  104.     public function setParcourssup(bool $parcourssup): self
  105.     {
  106.         $this->parcourssup $parcourssup;
  107.         return $this;
  108.     }
  109.     /**
  110.      * @return A
  111.      */
  112.     public function getUser(): A
  113.     {
  114.         return $this->users;
  115.     }
  116.     public function addUser(User $user): self
  117.     {
  118.         if (!$this->users->contains($user)) {
  119.             $this->users->add($user);
  120.             $user->setTraining($this);
  121.         }
  122.         return $this;
  123.     }
  124.     public function removeUser(User $user): self
  125.     {
  126.         if ($this->users->removeElement($user)) {
  127.             // set the owning side to null (unless already changed)
  128.             if ($user->getTraining() === $this) {
  129.                 $user->setTraining(null);
  130.             }
  131.         }
  132.         return $this;
  133.     }
  134.     /**
  135.      * @return A
  136.      */
  137.     public function getMCQTypes(): A
  138.     {
  139.         return $this->mCQTypes;
  140.     }
  141.     public function addMCQType(MCQType $mCQType): self
  142.     {
  143.         if (!$this->mCQTypes->contains($mCQType)) {
  144.             $this->mCQTypes->add($mCQType);
  145.             $mCQType->addTraining($this);
  146.         }
  147.         return $this;
  148.     }
  149.     public function removeMCQType(MCQType $mCQType): self
  150.     {
  151.         if ($this->mCQTypes->removeElement($mCQType)) {
  152.             $mCQType->removeTraining($this);
  153.         }
  154.         return $this;
  155.     }
  156.     public function getLevel(): ?string
  157.     {
  158.         return $this->level;
  159.     }
  160.     public function setLevel(?string $level): self
  161.     {
  162.         $this->level $level;
  163.         return $this;
  164.     }
  165.     /**
  166.      * @return A<int, Offer>
  167.      */
  168.     public function getOffers(): A
  169.     {
  170.         return $this->offers;
  171.     }
  172.     public function addOffer(Offer $offer): self
  173.     {
  174.         if (!$this->offers->contains($offer)) {
  175.             $this->offers->add($offer);
  176.             $offer->addTraining($this);
  177.         }
  178.         return $this;
  179.     }
  180.     public function removeOffer(Offer $offer): self
  181.     {
  182.         if ($this->offers->removeElement($offer)) {
  183.             $offer->removeTraining($this);
  184.         }
  185.         return $this;
  186.     }
  187.     /**
  188.      * @return A<int, Appointment>
  189.      */
  190.     public function getAppointments(): A
  191.     {
  192.         return $this->appointments;
  193.     }
  194.     public function addAppointment(Appointment $appointment): self
  195.     {
  196.         if (!$this->appointments->contains($appointment)) {
  197.             $this->appointments->add($appointment);
  198.             $appointment->addTraining($this);
  199.         }
  200.         return $this;
  201.     }
  202.     public function removeAppointment(Appointment $appointment): self
  203.     {
  204.         if ($this->appointments->removeElement($appointment)) {
  205.             $appointment->removeTraining($this);
  206.         }
  207.         return $this;
  208.     }
  209.     public function getLevelName(): ?string
  210.     {
  211.         return $this->levelName;
  212.     }
  213.     public function setLevelName(?string $levelName): self
  214.     {
  215.         $this->levelName $levelName;
  216.         return $this;
  217.     }
  218.     /**
  219.      * @return A<int, TrainingGroupAF>
  220.      */
  221.     public function getTrainingGroupAFs(): A
  222.     {
  223.         return $this->trainingGroupAFs;
  224.     }
  225.     public function addTrainingGroupAF(TrainingGroupAF $trainingGroupAF): self
  226.     {
  227.         if (!$this->trainingGroupAFs->contains($trainingGroupAF)) {
  228.             $this->trainingGroupAFs->add($trainingGroupAF);
  229.             $trainingGroupAF->setTraining($this);
  230.         }
  231.         return $this;
  232.     }
  233.     public function removeTrainingGroupAF(TrainingGroupAF $trainingGroupAF): self
  234.     {
  235.         if ($this->trainingGroupAFs->removeElement($trainingGroupAF)) {
  236.             // set the owning side to null (unless already changed)
  237.             if ($trainingGroupAF->getTraining() === $this) {
  238.                 $trainingGroupAF->setTraining(null);
  239.             }
  240.         }
  241.         return $this;
  242.     }
  243.     public function getClosingDate(): \DateTimeInterface|null
  244.     {
  245.         return $this->closing_date;
  246.     }
  247.     public function setClosingDate(\DateTimeInterface|null $closing_date): self
  248.     {
  249.         $this->closing_date $closing_date;
  250.         return $this;
  251.     }
  252. }