src/Entity/AgentInterne.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\User;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use App\Repository\AgentInterneRepository;
  8. #[ORM\Entity(repositoryClassAgentInterneRepository::class)]
  9. class AgentInterne extends User
  10. {
  11.     public const REGIONAL_ARRAY = [
  12.         'Central' => 'Central',
  13.         'Regional' => 'RĂ©gional',
  14.     ];
  15.     public const UNITE_ARRAY = [
  16.         'Tunis' => 'Tunis',
  17.                     'Beja' => 'Beja',
  18.                     'Ben Arous' => 'Ben Arous',
  19.                     'Ariana' => 'Ariana',
  20.                     'Bizerte' => 'Bizerte',
  21.                     'Gabes' => 'Gabes',
  22.                     'Gafsa' => 'Gafsa',
  23.                     'Jendouba' => 'Jendouba',
  24.                     'Kairouan' => 'Kairouan',
  25.                     'Kasserine' => 'Kasserine',
  26.                     'Kebilli' => 'Kebilli',
  27.                     'Kef' => 'Kef',
  28.                     'Mahdia' => 'Mahdia',
  29.                     'Manouba' => 'Manouba',
  30.                     'Medenine' => 'Medenine',
  31.                     'Monastir' => 'Monastir',
  32.                     'Nabeul' => 'Nabeul',
  33.                     'Sfax' => 'Sfax',
  34.                     'Sidi Bouzid' => 'Sidi Bouzid',
  35.                     'Siliana' => 'Siliana',
  36.                     'Sousse' => 'Sousse',
  37.                     'Tataouine' => 'Tataouine',
  38.                     'Tozeur' => 'Tozeur',
  39.                     'Zaghouan' => 'Zaghouan'
  40.     ];
  41.     #[ORM\Column(type'string'length255)]
  42.     private $nom;
  43.     #[ORM\Column(type'string'length255)]
  44.     private $prenom;
  45.     #[ORM\Column(type'string'length255)]
  46.     private $tel;
  47.     #[ORM\Column(type'string'length255)]
  48.     private $nom_administration;
  49.     #[ORM\Column(length255)]
  50.     private ?string $regional null;
  51.     #[ORM\Column(length255)]
  52.     private ?string $unite null;
  53.     #[ORM\Column(type'string'length255)]
  54.     private $fonction;
  55.     #[ORM\OneToMany(mappedBy'conseiller'targetEntityRapportEvaluation::class)]
  56.     private Collection $rapportEvaluations;
  57.     public function __construct()
  58.     {
  59.         parent::__construct();
  60.         $this->rapportEvaluations = new ArrayCollection();
  61.     }
  62.     public function getNom(): ?string
  63.     {
  64.         return $this->nom;
  65.     }
  66.     public function setNom(string $nom): self
  67.     {
  68.         $this->nom $nom;
  69.         return $this;
  70.     }
  71.     public function getPrenom(): ?string
  72.     {
  73.         return $this->prenom;
  74.     }
  75.     public function setPrenom(string $prenom): self
  76.     {
  77.         $this->prenom $prenom;
  78.         return $this;
  79.     }
  80.     public function getTel(): ?string
  81.     {
  82.         return $this->tel;
  83.     }
  84.     public function setTel(string $tel): self
  85.     {
  86.         $this->tel $tel;
  87.         return $this;
  88.     }
  89.     public function getNomAdministration(): ?string
  90.     {
  91.         return $this->nom_administration;
  92.     }
  93.     public function setNomAdministration(string $nom_administration): self
  94.     {
  95.         $this->nom_administration $nom_administration;
  96.         return $this;
  97.     }
  98.     public function getFonction(): ?string
  99.     {
  100.         return $this->fonction;
  101.     }
  102.     public function setFonction(string $fonction): self
  103.     {
  104.         $this->fonction $fonction;
  105.         return $this;
  106.     }
  107.     public function getRegional(): ?string
  108.     {
  109.         return $this->regional;
  110.     }
  111.     public function setRegional(string $regional): self
  112.     {
  113.         $this->regional $regional;
  114.         return $this;
  115.     }
  116.     public function getUnite(): ?string
  117.     {
  118.         return $this->unite;
  119.     }
  120.     public function setUnite(string $unite): self
  121.     {
  122.         $this->unite $unite;
  123.         return $this;
  124.     }
  125.     public function __toString()
  126.     {
  127.         return 'Central' === $this->getRegional() ? $this->getPrenom() . ' ' $this->getNom() . ' (Centrale)' $this->getPrenom() . ' ' $this->getNom() . ' (' $this->getUnite() . ')';
  128.     }
  129.     /**
  130.      * @return Collection<int, RapportEvaluation>
  131.      */
  132.     public function getRapportEvaluations(): Collection
  133.     {
  134.         return $this->rapportEvaluations;
  135.     }
  136.     public function addRapportEvaluation(RapportEvaluation $rapportEvaluation): self
  137.     {
  138.         if (!$this->rapportEvaluations->contains($rapportEvaluation)) {
  139.             $this->rapportEvaluations->add($rapportEvaluation);
  140.             $rapportEvaluation->setConseiller($this);
  141.         }
  142.         return $this;
  143.     }
  144.     public function removeRapportEvaluation(RapportEvaluation $rapportEvaluation): self
  145.     {
  146.         if ($this->rapportEvaluations->removeElement($rapportEvaluation)) {
  147.             // set the owning side to null (unless already changed)
  148.             if ($rapportEvaluation->getConseiller() === $this) {
  149.                 $rapportEvaluation->setConseiller(null);
  150.             }
  151.         }
  152.         return $this;
  153.     }
  154. }