src/Entity/Enseignant.php line 14

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EnseignantRepository;
  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. use Symfony\Component\HttpFoundation\File\File;
  9. use Symfony\Component\Serializer\Annotation\Groups;
  10. #[ORM\Entity(repositoryClassEnseignantRepository::class)]
  11. class Enseignant
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     #[Groups(['read:course:collection''read:payment:collection''read:forum:item'])]
  17.     private ?int $id null;
  18.     #[ORM\OneToMany(mappedBy'enseignant'targetEntityCours::class, orphanRemovaltrue)]
  19.     private Collection $cours;
  20.     #[ORM\OneToOne(inversedBy'enseignant'cascade: ['persist''remove'])]
  21.     #[ORM\JoinColumn(nullablefalse)]
  22.     #[Groups(['read:course:collection''read:payment:collection''read:forum:item'])]
  23.     private ?User $utilisateur null;
  24.     #[ORM\ManyToOne(inversedBy'enseignants')]
  25.     #[Groups(['read:course:collection'])]
  26.     private ?Etablissement $etablissement null;
  27.     #[ORM\Column(length100uniquetrue)]
  28.     #[Groups(['read:course:collection'])]
  29.     private ?string $reference null;
  30.     #[ORM\Column(length255,nullable:true)]
  31.     private ?string $diplome null;
  32.     #[ORM\Column(length255)]
  33.     private ?string $rectoCNI null;
  34.     #[ORM\Column(length255)]
  35.     private ?string $versoCNI null;
  36.     #[ORM\Column(length255)]
  37.     private ?string $selfieCNI null;
  38.     #[ORM\Column(length255,nullable:true)]
  39.     private ?string $emploiDuTemps null;
  40.     /**
  41.      * @var File
  42.      */
  43.     public $diplomeFile;
  44.     /**
  45.      * @var File
  46.      */
  47.     public $rectoCNIFile;
  48.     /**
  49.      * @var File
  50.      */
  51.     public $versoCNIFile;
  52.     /**
  53.      * @var File
  54.      */
  55.     public $selfieCNIFile;
  56.     /**
  57.      * @var File
  58.      */
  59.     public $emploiDuTempsFile;
  60.     #[ORM\Column]
  61.     private ?bool $isValidated null;
  62.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  63.     private ?string $details null;
  64.     #[ORM\Column(nullabletrue)]
  65.     private ?bool $isRejected null;
  66.     #[ORM\Column(typeTypes::SMALLINTnullabletrue)]
  67.     private ?int $review null;
  68.     #[ORM\Column(nullabletrue)]
  69.     private ?\DateTimeImmutable $joinAt null;
  70.     #[ORM\ManyToOne(inversedBy'enseignants')]
  71.     private ?Categorie $discipline null;
  72.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  73.     private ?string $aboutMe null;
  74.     #[ORM\Column(nullabletrue)]
  75.     private ?bool $isCertified null;
  76.     #[ORM\OneToMany(mappedBy'relation'targetEntityEvaluation::class)]
  77.     private Collection $evaluations;
  78.     #[ORM\OneToMany(mappedBy'teacherPersona'targetEntitySubjectChat::class, orphanRemovaltrue)]
  79.     private Collection $subjectChats;
  80.     #[ORM\OneToMany(mappedBy'teacherPersona'targetEntityMessageChat::class, orphanRemovaltrue)]
  81.     private Collection $messageChats;
  82.     public function __construct()
  83.     {
  84.         $this->cours = new ArrayCollection();
  85.         $this->isValidated false;
  86.         $this->evaluations = new ArrayCollection();
  87.         $this->subjectChats = new ArrayCollection();
  88.         $this->messageChats = new ArrayCollection();
  89.     }
  90.     public function getId(): ?int
  91.     {
  92.         return $this->id;
  93.     }
  94.     /**
  95.      * @return Collection<int, Cours>
  96.      */
  97.     public function getCours(): Collection
  98.     {
  99.         return $this->cours;
  100.     }
  101.     public function addCour(Cours $cour): self
  102.     {
  103.         if (!$this->cours->contains($cour)) {
  104.             $this->cours->add($cour);
  105.             $cour->setEnseignant($this);
  106.         }
  107.         return $this;
  108.     }
  109.     public function removeCour(Cours $cour): self
  110.     {
  111.         if ($this->cours->removeElement($cour)) {
  112.             // set the owning side to null (unless already changed)
  113.             if ($cour->getEnseignant() === $this) {
  114.                 $cour->setEnseignant(null);
  115.             }
  116.         }
  117.         return $this;
  118.     }
  119.     public function getUtilisateur(): ?User
  120.     {
  121.         return $this->utilisateur;
  122.     }
  123.     public function setUtilisateur(User $utilisateur): self
  124.     {
  125.         $this->utilisateur $utilisateur;
  126.         return $this;
  127.     }
  128.     public function getEtablissement(): ?Etablissement
  129.     {
  130.         return $this->etablissement;
  131.     }
  132.     public function setEtablissement(?Etablissement $etablissement): self
  133.     {
  134.         $this->etablissement $etablissement;
  135.         return $this;
  136.     }
  137.     public function getReference(): ?string
  138.     {
  139.         return $this->reference;
  140.     }
  141.     public function setReference(string $reference): self
  142.     {
  143.         $this->reference $reference;
  144.         return $this;
  145.     }
  146.     public function getDiplome(): ?string
  147.     {
  148.         return $this->diplome;
  149.     }
  150.     public function setDiplome(?string $diplome): self
  151.     {
  152.         $this->diplome $diplome;
  153.         return $this;
  154.     }
  155.     public function getRectoCNI(): ?string
  156.     {
  157.         return $this->rectoCNI;
  158.     }
  159.     public function setRectoCNI(string $rectoCNI): self
  160.     {
  161.         $this->rectoCNI $rectoCNI;
  162.         return $this;
  163.     }
  164.     public function getVersoCNI(): ?string
  165.     {
  166.         return $this->versoCNI;
  167.     }
  168.     public function setVersoCNI(string $versoCNI): self
  169.     {
  170.         $this->versoCNI $versoCNI;
  171.         return $this;
  172.     }
  173.     public function getSelfieCNI(): ?string
  174.     {
  175.         return $this->selfieCNI;
  176.     }
  177.     public function setSelfieCNI(string $selfieCNI): self
  178.     {
  179.         $this->selfieCNI $selfieCNI;
  180.         return $this;
  181.     }
  182.     public function getEmploiDuTemps(): ?string
  183.     {
  184.         return $this->emploiDuTemps;
  185.     }
  186.     public function setEmploiDuTemps(?string $emploiDuTemps): self
  187.     {
  188.         $this->emploiDuTemps $emploiDuTemps;
  189.         return $this;
  190.     }
  191.     public function isIsValidated(): ?bool
  192.     {
  193.         return $this->isValidated;
  194.     }
  195.     public function setIsValidated(bool $isValidated): self
  196.     {
  197.         $this->isValidated $isValidated;
  198.         return $this;
  199.     }
  200.     public function getDetails(): ?string
  201.     {
  202.         return $this->details;
  203.     }
  204.     public function setDetails(?string $details): self
  205.     {
  206.         $this->details $details;
  207.         return $this;
  208.     }
  209.     public function isIsRejected(): ?bool
  210.     {
  211.         return $this->isRejected;
  212.     }
  213.     public function setIsRejected(?bool $isRejected): self
  214.     {
  215.         $this->isRejected $isRejected;
  216.         return $this;
  217.     }
  218.     public function getReview(): ?int
  219.     {
  220.         return $this->review;
  221.     }
  222.     public function setReview(?int $review): self
  223.     {
  224.         $this->review $review;
  225.         return $this;
  226.     }
  227.     public function getJoinAt(): ?\DateTimeImmutable
  228.     {
  229.         return $this->joinAt;
  230.     }
  231.     public function setJoinAt(?\DateTimeImmutable $joinAt): self
  232.     {
  233.         $this->joinAt $joinAt;
  234.         return $this;
  235.     }
  236.     public function getAvatar(): ?string
  237.     {
  238.         return "uploads/images/enseignants/kyc/" $this->getUtilisateur()->getPersonne()->getAvatar();
  239.     }
  240.     public function getDiscipline(): ?Categorie
  241.     {
  242.         return $this->discipline;
  243.     }
  244.     public function setDiscipline(?Categorie $discipline): self
  245.     {
  246.         $this->discipline $discipline;
  247.         return $this;
  248.     }
  249.     public function getAboutMe(): ?string
  250.     {
  251.         return $this->aboutMe;
  252.     }
  253.     public function setAboutMe(?string $aboutMe): self
  254.     {
  255.         $this->aboutMe $aboutMe;
  256.         return $this;
  257.     }
  258.     public function isIsCertified(): ?bool
  259.     {
  260.         return $this->isCertified;
  261.     }
  262.     public function setIsCertified(?bool $isCertified): self
  263.     {
  264.         $this->isCertified $isCertified;
  265.         return $this;
  266.     }
  267.     /**
  268.      * @return Collection<int, Evaluation>
  269.      */
  270.     public function getEvaluations(): Collection
  271.     {
  272.         return $this->evaluations;
  273.     }
  274.     public function addEvaluation(Evaluation $evaluation): static
  275.     {
  276.         if (!$this->evaluations->contains($evaluation)) {
  277.             $this->evaluations->add($evaluation);
  278.             $evaluation->setRelation($this);
  279.         }
  280.         return $this;
  281.     }
  282.     public function removeEvaluation(Evaluation $evaluation): static
  283.     {
  284.         if ($this->evaluations->removeElement($evaluation)) {
  285.             // set the owning side to null (unless already changed)
  286.             if ($evaluation->getRelation() === $this) {
  287.                 $evaluation->setRelation(null);
  288.             }
  289.         }
  290.         return $this;
  291.     }
  292.     /**
  293.      * @return Collection<int, SubjectChat>
  294.      */
  295.     public function getSubjectChats(): Collection
  296.     {
  297.         return $this->subjectChats;
  298.     }
  299.     public function addSubjectChat(SubjectChat $subjectChat): static
  300.     {
  301.         if (!$this->subjectChats->contains($subjectChat)) {
  302.             $this->subjectChats->add($subjectChat);
  303.             $subjectChat->setTeacherPersona($this);
  304.         }
  305.         return $this;
  306.     }
  307.     public function removeSubjectChat(SubjectChat $subjectChat): static
  308.     {
  309.         if ($this->subjectChats->removeElement($subjectChat)) {
  310.             // set the owning side to null (unless already changed)
  311.             if ($subjectChat->getTeacherPersona() === $this) {
  312.                 $subjectChat->setTeacherPersona(null);
  313.             }
  314.         }
  315.         return $this;
  316.     }
  317.     /**
  318.      * @return Collection<int, MessageChat>
  319.      */
  320.     public function getMessageChats(): Collection
  321.     {
  322.         return $this->messageChats;
  323.     }
  324.     public function addMessageChat(MessageChat $messageChat): static
  325.     {
  326.         if (!$this->messageChats->contains($messageChat)) {
  327.             $this->messageChats->add($messageChat);
  328.             $messageChat->setTeacherPersona($this);
  329.         }
  330.         return $this;
  331.     }
  332.     public function removeMessageChat(MessageChat $messageChat): static
  333.     {
  334.         if ($this->messageChats->removeElement($messageChat)) {
  335.             // set the owning side to null (unless already changed)
  336.             if ($messageChat->getTeacherPersona() === $this) {
  337.                 $messageChat->setTeacherPersona(null);
  338.             }
  339.         }
  340.         return $this;
  341.     }
  342. }