src/Entity/Program.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProgramRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use App\Traits\EntityDateTimeAbleTrait;
  7. use App\Traits\SeoTrait;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Mapping\Annotation as Gedmo;
  10. #[ORM\Entity(repositoryClassProgramRepository::class)]
  11. #[ORM\HasLifecycleCallbacks]
  12. class Program
  13. {
  14.     use EntityDateTimeAbleTrait;
  15.     use SeoTrait;
  16.     const LEVEL_BTS 1;
  17.     const LEVEL_BACHELOR 2;
  18.     const LEVEL_MBA 3;
  19.     const TRANNING_BTS = [
  20.         "module1" => "BTS 1ère année",
  21.         "module2" => "BTS 2ème année"
  22.     ];
  23.     const TRANNING_BACHELOR = [
  24.         "module1" => "Bachelor - 1ère année",
  25.         "module2" => "Bachelor - 2ème année",
  26.         "module3" => "Bachelor - 3ème année"
  27.     ];
  28.     const TRANNING_MBA = [
  29.         "module1" => "MBA/Msc 1 - BAC +4",
  30.         "module2" => "MBA/Msc 2 - BAC +5"
  31.     ];
  32.     const STATUS_ACTIVE  1;
  33.     const STATUS_INACTIVE 0;
  34.     const STATUS_IN_BO 2;
  35.     #[ORM\Id]
  36.     #[ORM\GeneratedValue]
  37.     #[ORM\Column(type'integer')]
  38.     private $id;
  39.     /**
  40.      * @Gedmo\Translatable
  41.      */
  42.     #[ORM\Column(type'string'length255nullabletrue)]
  43.     private ?string $name null;
  44.     #[ORM\Column(type'string'length255nullabletrue)]
  45.     private $slug;
  46.     #[ORM\Column(type'integer'nullabletrue)]
  47.     private ?int $status null;
  48.     #[ORM\ManyToMany(targetEntityProfile::class, mappedBy'programs')]
  49.     private Collection $profiles;
  50.     #[ORM\ManyToMany(targetEntityAppointmentPerson::class, mappedBy'programs')]
  51.     private Collection $appointmentPerson;
  52.     #[ORM\OneToMany(targetEntityProfile::class, mappedBy'selectedProgram'orphanRemovaltrue)]
  53.     private Collection $selectedProfiles;
  54.     #[ORM\ManyToMany(targetEntityQcm::class, inversedBy'programs')]
  55.     private Collection $qcm;
  56.     #[ORM\Column(type'integer'nullabletrue)]
  57.     private ?int $level null;
  58.     #[ORM\Column(type'string'length255nullabletrue)]
  59.     private ?string $pace null;
  60.     #[ORM\Column(type'string'length255nullabletrue)]
  61.     private ?string $rncp null;
  62.     /**
  63.      * @Gedmo\Translatable
  64.      */
  65.     #[ORM\Column(type'json'nullabletrue)]
  66.     private ?array $metadata = [];
  67.     #[ORM\ManyToMany(targetEntityCampus::class, inversedBy'programs')]
  68.     private Collection $campuses;
  69.     #[ORM\ManyToMany(targetEntityCursus::class, inversedBy'programs')]
  70.     private Collection $cursus;
  71.     #[ORM\OneToOne(targetEntityMedia::class, orphanRemovaltrue)]
  72.     private ?\App\Entity\Media $brochure null;
  73.     /**
  74.      * @Gedmo\Translatable
  75.      */
  76.     #[ORM\Column(type'text'nullabletrue)]
  77.     private ?string $description null;
  78.     #[ORM\OneToOne(targetEntityMedia::class, orphanRemovaltrue)]
  79.     private ?\App\Entity\Media $media null;
  80.     #[ORM\Column(type'json'nullabletrue)]
  81.     private ?array $entreprise = [];
  82.     #[ORM\Column(type'integer'nullabletrue)]
  83.     private ?int $specialityId null;
  84.     #[ORM\Column(type'integer'nullabletrue)]
  85.     private ?int $ordering null;
  86.     #[ORM\Column(type'boolean'nullabletrue)]
  87.     private ?bool $isRegister null;
  88.     #[ORM\Column(type'boolean'nullabletrue)]
  89.     private ?bool $isInitial null;
  90.     #[ORM\Column(type'boolean'nullabletrue)]
  91.     private ?bool $isAlternance null;
  92.     #[ORM\Column(type'integer'nullabletrue)]
  93.     private ?int $year null;
  94.     #[ORM\Column(nullabletrue)]
  95.     private ?int $rncpLevel null;
  96.     public function __construct()
  97.     {
  98.         $this->profiles = new ArrayCollection();
  99.         $this->appointmentPerson = new ArrayCollection();
  100.         $this->selectedProfiles = new ArrayCollection();
  101.         $this->qcm = new ArrayCollection();
  102.         $this->campuses = new ArrayCollection();
  103.         $this->cursus = new ArrayCollection();
  104.     }
  105.     public function getId(): ?int
  106.     {
  107.         return $this->id;
  108.     }
  109.     public function getName(): ?string
  110.     {
  111.         return $this->name;
  112.     }
  113.     public function setName(?string $name): self
  114.     {
  115.         $this->name $name;
  116.         return $this;
  117.     }
  118.     public function getSlug(): ?string
  119.     {
  120.         return $this->slug;
  121.     }
  122.     public function setSlug(?string $slug): self
  123.     {
  124.         $this->slug $slug;
  125.         return $this;
  126.     }
  127.     public function getStatus(): ?int
  128.     {
  129.         return $this->status;
  130.     }
  131.     public function setStatus(?int $status): self
  132.     {
  133.         $this->status $status;
  134.         return $this;
  135.     }
  136.     /**
  137.      * @return Collection<int, Profile>
  138.      */
  139.     public function getProfiles(): Collection
  140.     {
  141.         return $this->profiles;
  142.     }
  143.     public function addProfile(Profile $profile): self
  144.     {
  145.         if (!$this->profiles->contains($profile)) {
  146.             $this->profiles[] = $profile;
  147.             $profile->addProgram($this);
  148.         }
  149.         return $this;
  150.     }
  151.     public function removeProfile(Profile $profile): self
  152.     {
  153.         if ($this->profiles->removeElement($profile)) {
  154.             $profile->removeProgram($this);
  155.         }
  156.         return $this;
  157.     }
  158.     /**
  159.      * @return Collection<int, AppointmentPerson>
  160.      */
  161.     public function getAppointmentPerson(): Collection
  162.     {
  163.         return $this->appointmentPerson;
  164.     }
  165.     public function addAppointmentPerson(AppointmentPerson $appointmentPerson): self
  166.     {
  167.         if (!$this->appointmentPerson->contains($appointmentPerson)) {
  168.             $this->appointmentPerson[] = $appointmentPerson;
  169.             $appointmentPerson->addProgram($this);
  170.         }
  171.         return $this;
  172.     }
  173.     public function removeAppointmentPerson(AppointmentPerson $appointmentPerson): self
  174.     {
  175.         if ($this->appointmentPerson->removeElement($appointmentPerson)) {
  176.             $appointmentPerson->removeProgram($this);
  177.         }
  178.         return $this;
  179.     }
  180.     /**
  181.      * @return Collection<int, Profile>
  182.      */
  183.     public function getSelectedProfiles(): Collection
  184.     {
  185.         return $this->selectedProfiles;
  186.     }
  187.     public function addSelectedProfile(Profile $selectedProfile): self
  188.     {
  189.         if (!$this->selectedProfiles->contains($selectedProfile)) {
  190.             $this->selectedProfiles[] = $selectedProfile;
  191.             $selectedProfile->setSelectedProgram($this);
  192.         }
  193.         return $this;
  194.     }
  195.     public function removeSelectedProfile(Profile $selectedProfile): self
  196.     {
  197.         if ($this->selectedProfiles->removeElement($selectedProfile)) {
  198.             // set the owning side to null (unless already changed)
  199.             if ($selectedProfile->getSelectedProgram() === $this) {
  200.                 $selectedProfile->setSelectedProgram(null);
  201.             }
  202.         }
  203.         return $this;
  204.     }
  205.     /**
  206.      * @return Collection<int, Qcm>
  207.      */
  208.     public function getQcm(): Collection
  209.     {
  210.         return $this->qcm;
  211.     }
  212.     public function addQcm(Qcm $qcm): self
  213.     {
  214.         if (!$this->qcm->contains($qcm)) {
  215.             $this->qcm[] = $qcm;
  216.         }
  217.         return $this;
  218.     }
  219.     public function removeQcm(Qcm $qcm): self
  220.     {
  221.         $this->qcm->removeElement($qcm);
  222.         return $this;
  223.     }
  224.     public function getLevel(): ?int
  225.     {
  226.         return $this->level;
  227.     }
  228.     public function setLevel(?int $level): self
  229.     {
  230.         $this->level $level;
  231.         return $this;
  232.     }
  233.     public function getPace(): ?string
  234.     {
  235.         return $this->pace;
  236.     }
  237.     public function setPace(?string $pace): self
  238.     {
  239.         $this->pace $pace;
  240.         return $this;
  241.     }
  242.     public function getRncp(): ?string
  243.     {
  244.         return $this->rncp;
  245.     }
  246.     public function setRncp(?string $rncp): self
  247.     {
  248.         $this->rncp $rncp;
  249.         return $this;
  250.     }
  251.     public function getMetadata(): ?array
  252.     {
  253.         return $this->metadata;
  254.     }
  255.     public function setMetadata(?array $metadata): self
  256.     {
  257.         $this->metadata $metadata;
  258.         return $this;
  259.     }
  260.     /**
  261.      * @return Collection|Campus[]
  262.      */
  263.     public function getCampuses(): Collection
  264.     {
  265.         return $this->campuses;
  266.     }
  267.     public function addCampus(Campus $campus): self
  268.     {
  269.         if (!$this->campuses->contains($campus)) {
  270.             $this->campuses[] = $campus;
  271.         }
  272.         return $this;
  273.     }
  274.     public function removeCampus(Campus $campus): self
  275.     {
  276.         $this->campuses->removeElement($campus);
  277.         return $this;
  278.     }
  279.     /**
  280.      * @return Collection<int, Cursus>
  281.      */
  282.     public function getCursus(): Collection
  283.     {
  284.         return $this->cursus;
  285.     }
  286.     public function addCursu(Cursus $cursu): self
  287.     {
  288.         if (!$this->cursus->contains($cursu)) {
  289.             $this->cursus[] = $cursu;
  290.         }
  291.         return $this;
  292.     }
  293.     public function removeCursu(Cursus $cursu): self
  294.     {
  295.         $this->cursus->removeElement($cursu);
  296.         return $this;
  297.     }
  298.     public function getBrochure(): ?Media
  299.     {
  300.         return $this->brochure;
  301.     }
  302.     public function setBrochure(?Media $brochure): self
  303.     {
  304.         $this->brochure $brochure;
  305.         return $this;
  306.     }
  307.     public function getDescription(): ?string
  308.     {
  309.         return $this->description;
  310.     }
  311.     public function setDescription(?string $description): self
  312.     {
  313.         $this->description $description;
  314.         return $this;
  315.     }
  316.     public function getMedia(): ?Media
  317.     {
  318.         return $this->media;
  319.     }
  320.     public function setMedia(?Media $media): self
  321.     {
  322.         $this->media $media;
  323.         return $this;
  324.     }
  325.     public function getEntreprise(): ?array
  326.     {
  327.         return $this->entreprise;
  328.     }
  329.     public function setEntreprise(?array $entreprise): self
  330.     {
  331.         $this->entreprise $entreprise;
  332.         return $this;
  333.     }
  334.     public function getSpecialityId(): ?int
  335.     {
  336.         return $this->specialityId;
  337.     }
  338.     public function setSpecialityId(?int $specialityId): self
  339.     {
  340.         $this->specialityId $specialityId;
  341.         return $this;
  342.     }
  343.     public function getOrdering(): ?int
  344.     {
  345.         return $this->ordering;
  346.     }
  347.     public function setOrdering(?int $ordering): self
  348.     {
  349.         $this->ordering $ordering;
  350.         return $this;
  351.     }
  352.     public function getIsRegister(): ?bool
  353.     {
  354.         return $this->isRegister;
  355.     }
  356.     public function setIsRegister(?bool $isRegister): self
  357.     {
  358.         $this->isRegister $isRegister;
  359.         return $this;
  360.     }
  361.     public function getIsInitial(): ?bool
  362.     {
  363.         return $this->isInitial;
  364.     }
  365.     public function setIsInitial(?bool $isInitial): self
  366.     {
  367.         $this->isInitial $isInitial;
  368.         return $this;
  369.     }
  370.     public function getIsAlternance(): ?bool
  371.     {
  372.         return $this->isAlternance;
  373.     }
  374.     public function setIsAlternance(?bool $isAlternance): self
  375.     {
  376.         $this->isAlternance $isAlternance;
  377.         return $this;
  378.     }
  379.     public function getYear(): ?int
  380.     {
  381.         return $this->year;
  382.     }
  383.     public function setYear(?int $year): self
  384.     {
  385.         $this->year $year;
  386.         return $this;
  387.     }
  388.     public function getRncpLevel(): ?int
  389.     {
  390.         return $this->rncpLevel;
  391.     }
  392.     public function setRncpLevel(?int $rncpLevel): static
  393.     {
  394.         $this->rncpLevel $rncpLevel;
  395.         return $this;
  396.     }
  397. }