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 TRANNING_PROGRAM31 = [
  33.         "module1" => "Année 1",
  34.         "module2" => "Année 2"
  35.     ];
  36.     const SCHOOLS = [
  37.         => "PE Estiam School of IT",
  38.         => "PE School of Design",
  39.         => "School of Management",
  40.         => "Baguette Academy"
  41.     ];
  42.     const STATUS_ACTIVE  1;
  43.     const STATUS_INACTIVE 0;
  44.     const STATUS_IN_BO 2;
  45.     #[ORM\Id]
  46.     #[ORM\GeneratedValue]
  47.     #[ORM\Column(type'integer')]
  48.     private $id;
  49.     /**
  50.      * @Gedmo\Translatable
  51.      */
  52.     #[ORM\Column(type'string'length255nullabletrue)]
  53.     private ?string $name null;
  54.     #[ORM\Column(type'string'length255nullabletrue)]
  55.     private $slug;
  56.     #[ORM\Column(type'integer'nullabletrue)]
  57.     private ?int $status null;
  58.     #[ORM\ManyToMany(targetEntityProfile::class, mappedBy'programs')]
  59.     private Collection $profiles;
  60.     #[ORM\ManyToMany(targetEntityAppointmentPerson::class, mappedBy'programs')]
  61.     private Collection $appointmentPerson;
  62.     #[ORM\OneToMany(targetEntityProfile::class, mappedBy'selectedProgram'orphanRemovaltrue)]
  63.     private Collection $selectedProfiles;
  64.     #[ORM\ManyToMany(targetEntityQcm::class, inversedBy'programs')]
  65.     private Collection $qcm;
  66.     #[ORM\Column(type'integer'nullabletrue)]
  67.     private ?int $level null;
  68.     #[ORM\Column(type'string'length255nullabletrue)]
  69.     private ?string $pace null;
  70.     #[ORM\Column(type'string'length255nullabletrue)]
  71.     private ?string $rncp null;
  72.     /**
  73.      * @Gedmo\Translatable
  74.      */
  75.     #[ORM\Column(type'json'nullabletrue)]
  76.     private ?array $metadata = [];
  77.     #[ORM\ManyToMany(targetEntityCampus::class, inversedBy'programs')]
  78.     private Collection $campuses;
  79.     #[ORM\ManyToMany(targetEntityCursus::class, inversedBy'programs')]
  80.     private Collection $cursus;
  81.     #[ORM\OneToOne(targetEntityMedia::class, orphanRemovaltrue)]
  82.     private ?\App\Entity\Media $brochure null;
  83.     /**
  84.      * @Gedmo\Translatable
  85.      */
  86.     #[ORM\Column(type'text'nullabletrue)]
  87.     private ?string $description null;
  88.     #[ORM\OneToOne(targetEntityMedia::class, orphanRemovaltrue)]
  89.     private ?\App\Entity\Media $media null;
  90.     #[ORM\Column(type'json'nullabletrue)]
  91.     private ?array $entreprise = [];
  92.     #[ORM\Column(type'integer'nullabletrue)]
  93.     private ?int $specialityId null;
  94.     #[ORM\Column(type'integer'nullabletrue)]
  95.     private ?int $ordering null;
  96.     #[ORM\Column(type'boolean'nullabletrue)]
  97.     private ?bool $isRegister null;
  98.     #[ORM\Column(type'boolean'nullabletrue)]
  99.     private ?bool $isInitial null;
  100.     #[ORM\Column(type'boolean'nullabletrue)]
  101.     private ?bool $isAlternance null;
  102.     #[ORM\Column(type'integer'nullabletrue)]
  103.     private ?int $year null;
  104.     #[ORM\Column(nullabletrue)]
  105.     private ?int $rncpLevel null;
  106.     #[ORM\OneToMany(mappedBy'program'targetEntityInvoice::class)]
  107.     private Collection $invoices;
  108.     #[ORM\Column(nullabletrue)]
  109.     private ?bool $isAgent null;
  110.     #[ORM\Column(nullabletrue)]
  111.     private ?int $school null;
  112.     public function __construct()
  113.     {
  114.         $this->profiles = new ArrayCollection();
  115.         $this->appointmentPerson = new ArrayCollection();
  116.         $this->selectedProfiles = new ArrayCollection();
  117.         $this->qcm = new ArrayCollection();
  118.         $this->campuses = new ArrayCollection();
  119.         $this->cursus = new ArrayCollection();
  120.         $this->invoices = new ArrayCollection();
  121.     }
  122.     public function getId(): ?int
  123.     {
  124.         return $this->id;
  125.     }
  126.     public function getName(): ?string
  127.     {
  128.         return $this->name;
  129.     }
  130.     public function setName(?string $name): self
  131.     {
  132.         $this->name $name;
  133.         return $this;
  134.     }
  135.     public function getSlug(): ?string
  136.     {
  137.         return $this->slug;
  138.     }
  139.     public function setSlug(?string $slug): self
  140.     {
  141.         $this->slug $slug;
  142.         return $this;
  143.     }
  144.     public function getStatus(): ?int
  145.     {
  146.         return $this->status;
  147.     }
  148.     public function setStatus(?int $status): self
  149.     {
  150.         $this->status $status;
  151.         return $this;
  152.     }
  153.     /**
  154.      * @return Collection<int, Profile>
  155.      */
  156.     public function getProfiles(): Collection
  157.     {
  158.         return $this->profiles;
  159.     }
  160.     public function addProfile(Profile $profile): self
  161.     {
  162.         if (!$this->profiles->contains($profile)) {
  163.             $this->profiles[] = $profile;
  164.             $profile->addProgram($this);
  165.         }
  166.         return $this;
  167.     }
  168.     public function removeProfile(Profile $profile): self
  169.     {
  170.         if ($this->profiles->removeElement($profile)) {
  171.             $profile->removeProgram($this);
  172.         }
  173.         return $this;
  174.     }
  175.     /**
  176.      * @return Collection<int, AppointmentPerson>
  177.      */
  178.     public function getAppointmentPerson(): Collection
  179.     {
  180.         return $this->appointmentPerson;
  181.     }
  182.     public function addAppointmentPerson(AppointmentPerson $appointmentPerson): self
  183.     {
  184.         if (!$this->appointmentPerson->contains($appointmentPerson)) {
  185.             $this->appointmentPerson[] = $appointmentPerson;
  186.             $appointmentPerson->addProgram($this);
  187.         }
  188.         return $this;
  189.     }
  190.     public function removeAppointmentPerson(AppointmentPerson $appointmentPerson): self
  191.     {
  192.         if ($this->appointmentPerson->removeElement($appointmentPerson)) {
  193.             $appointmentPerson->removeProgram($this);
  194.         }
  195.         return $this;
  196.     }
  197.     /**
  198.      * @return Collection<int, Profile>
  199.      */
  200.     public function getSelectedProfiles(): Collection
  201.     {
  202.         return $this->selectedProfiles;
  203.     }
  204.     public function addSelectedProfile(Profile $selectedProfile): self
  205.     {
  206.         if (!$this->selectedProfiles->contains($selectedProfile)) {
  207.             $this->selectedProfiles[] = $selectedProfile;
  208.             $selectedProfile->setSelectedProgram($this);
  209.         }
  210.         return $this;
  211.     }
  212.     public function removeSelectedProfile(Profile $selectedProfile): self
  213.     {
  214.         if ($this->selectedProfiles->removeElement($selectedProfile)) {
  215.             // set the owning side to null (unless already changed)
  216.             if ($selectedProfile->getSelectedProgram() === $this) {
  217.                 $selectedProfile->setSelectedProgram(null);
  218.             }
  219.         }
  220.         return $this;
  221.     }
  222.     /**
  223.      * @return Collection<int, Qcm>
  224.      */
  225.     public function getQcm(): Collection
  226.     {
  227.         return $this->qcm;
  228.     }
  229.     public function addQcm(Qcm $qcm): self
  230.     {
  231.         if (!$this->qcm->contains($qcm)) {
  232.             $this->qcm[] = $qcm;
  233.         }
  234.         return $this;
  235.     }
  236.     public function removeQcm(Qcm $qcm): self
  237.     {
  238.         $this->qcm->removeElement($qcm);
  239.         return $this;
  240.     }
  241.     public function getLevel(): ?int
  242.     {
  243.         return $this->level;
  244.     }
  245.     public function setLevel(?int $level): self
  246.     {
  247.         $this->level $level;
  248.         return $this;
  249.     }
  250.     public function getPace(): ?string
  251.     {
  252.         return $this->pace;
  253.     }
  254.     public function setPace(?string $pace): self
  255.     {
  256.         $this->pace $pace;
  257.         return $this;
  258.     }
  259.     public function getRncp(): ?string
  260.     {
  261.         return $this->rncp;
  262.     }
  263.     public function setRncp(?string $rncp): self
  264.     {
  265.         $this->rncp $rncp;
  266.         return $this;
  267.     }
  268.     public function getMetadata(): ?array
  269.     {
  270.         return $this->metadata;
  271.     }
  272.     public function setMetadata(?array $metadata): self
  273.     {
  274.         $this->metadata $metadata;
  275.         return $this;
  276.     }
  277.     /**
  278.      * @return Collection|Campus[]
  279.      */
  280.     public function getCampuses(): Collection
  281.     {
  282.         return $this->campuses;
  283.     }
  284.     public function addCampus(Campus $campus): self
  285.     {
  286.         if (!$this->campuses->contains($campus)) {
  287.             $this->campuses[] = $campus;
  288.         }
  289.         return $this;
  290.     }
  291.     public function removeCampus(Campus $campus): self
  292.     {
  293.         $this->campuses->removeElement($campus);
  294.         return $this;
  295.     }
  296.     /**
  297.      * @return Collection<int, Cursus>
  298.      */
  299.     public function getCursus(): Collection
  300.     {
  301.         return $this->cursus;
  302.     }
  303.     public function addCursu(Cursus $cursu): self
  304.     {
  305.         if (!$this->cursus->contains($cursu)) {
  306.             $this->cursus[] = $cursu;
  307.         }
  308.         return $this;
  309.     }
  310.     public function removeCursu(Cursus $cursu): self
  311.     {
  312.         $this->cursus->removeElement($cursu);
  313.         return $this;
  314.     }
  315.     public function getBrochure(): ?Media
  316.     {
  317.         return $this->brochure;
  318.     }
  319.     public function setBrochure(?Media $brochure): self
  320.     {
  321.         $this->brochure $brochure;
  322.         return $this;
  323.     }
  324.     public function getDescription(): ?string
  325.     {
  326.         return $this->description;
  327.     }
  328.     public function setDescription(?string $description): self
  329.     {
  330.         $this->description $description;
  331.         return $this;
  332.     }
  333.     public function getMedia(): ?Media
  334.     {
  335.         return $this->media;
  336.     }
  337.     public function setMedia(?Media $media): self
  338.     {
  339.         $this->media $media;
  340.         return $this;
  341.     }
  342.     public function getEntreprise(): ?array
  343.     {
  344.         return $this->entreprise;
  345.     }
  346.     public function setEntreprise(?array $entreprise): self
  347.     {
  348.         $this->entreprise $entreprise;
  349.         return $this;
  350.     }
  351.     public function getSpecialityId(): ?int
  352.     {
  353.         return $this->specialityId;
  354.     }
  355.     public function setSpecialityId(?int $specialityId): self
  356.     {
  357.         $this->specialityId $specialityId;
  358.         return $this;
  359.     }
  360.     public function getOrdering(): ?int
  361.     {
  362.         return $this->ordering;
  363.     }
  364.     public function setOrdering(?int $ordering): self
  365.     {
  366.         $this->ordering $ordering;
  367.         return $this;
  368.     }
  369.     public function getIsRegister(): ?bool
  370.     {
  371.         return $this->isRegister;
  372.     }
  373.     public function setIsRegister(?bool $isRegister): self
  374.     {
  375.         $this->isRegister $isRegister;
  376.         return $this;
  377.     }
  378.     public function getIsInitial(): ?bool
  379.     {
  380.         return $this->isInitial;
  381.     }
  382.     public function setIsInitial(?bool $isInitial): self
  383.     {
  384.         $this->isInitial $isInitial;
  385.         return $this;
  386.     }
  387.     public function getIsAlternance(): ?bool
  388.     {
  389.         return $this->isAlternance;
  390.     }
  391.     public function setIsAlternance(?bool $isAlternance): self
  392.     {
  393.         $this->isAlternance $isAlternance;
  394.         return $this;
  395.     }
  396.     public function getYear(): ?int
  397.     {
  398.         return $this->year;
  399.     }
  400.     public function setYear(?int $year): self
  401.     {
  402.         $this->year $year;
  403.         return $this;
  404.     }
  405.     public function getRncpLevel(): ?int
  406.     {
  407.         return $this->rncpLevel;
  408.     }
  409.     public function setRncpLevel(?int $rncpLevel): static
  410.     {
  411.         $this->rncpLevel $rncpLevel;
  412.         return $this;
  413.     }
  414.     /**
  415.      * @return Collection<int, Invoice>
  416.      */
  417.     public function getInvoices(): Collection
  418.     {
  419.         return $this->invoices;
  420.     }
  421.     public function addInvoice(Invoice $invoice): static
  422.     {
  423.         if (!$this->invoices->contains($invoice)) {
  424.             $this->invoices->add($invoice);
  425.             $invoice->setProgram($this);
  426.         }
  427.         return $this;
  428.     }
  429.     public function removeInvoice(Invoice $invoice): static
  430.     {
  431.         if ($this->invoices->removeElement($invoice)) {
  432.             // set the owning side to null (unless already changed)
  433.             if ($invoice->getProgram() === $this) {
  434.                 $invoice->setProgram(null);
  435.             }
  436.         }
  437.         return $this;
  438.     }
  439.     public function isIsAgent(): ?bool
  440.     {
  441.         return $this->isAgent;
  442.     }
  443.     public function setIsAgent(?bool $isAgent): static
  444.     {
  445.         $this->isAgent $isAgent;
  446.         return $this;
  447.     }
  448.     public function getSchool(): ?int
  449.     {
  450.         return $this->school;
  451.     }
  452.     public function setSchool(?int $school): static
  453.     {
  454.         $this->school $school;
  455.         return $this;
  456.     }
  457. }