<?php
namespace App\Entity;
use App\Entity\User;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\AgentInterneRepository;
#[ORM\Entity(repositoryClass: AgentInterneRepository::class)]
class AgentInterne extends User
{
public const REGIONAL_ARRAY = [
'Central' => 'Central',
'Regional' => 'Régional',
];
public const UNITE_ARRAY = [
'Tunis' => 'Tunis',
'Beja' => 'Beja',
'Ben Arous' => 'Ben Arous',
'Ariana' => 'Ariana',
'Bizerte' => 'Bizerte',
'Gabes' => 'Gabes',
'Gafsa' => 'Gafsa',
'Jendouba' => 'Jendouba',
'Kairouan' => 'Kairouan',
'Kasserine' => 'Kasserine',
'Kebilli' => 'Kebilli',
'Kef' => 'Kef',
'Mahdia' => 'Mahdia',
'Manouba' => 'Manouba',
'Medenine' => 'Medenine',
'Monastir' => 'Monastir',
'Nabeul' => 'Nabeul',
'Sfax' => 'Sfax',
'Sidi Bouzid' => 'Sidi Bouzid',
'Siliana' => 'Siliana',
'Sousse' => 'Sousse',
'Tataouine' => 'Tataouine',
'Tozeur' => 'Tozeur',
'Zaghouan' => 'Zaghouan'
];
#[ORM\Column(type: 'string', length: 255)]
private $nom;
#[ORM\Column(type: 'string', length: 255)]
private $prenom;
#[ORM\Column(type: 'string', length: 255)]
private $tel;
#[ORM\Column(type: 'string', length: 255)]
private $nom_administration;
#[ORM\Column(length: 255)]
private ?string $regional = null;
#[ORM\Column(length: 255)]
private ?string $unite = null;
#[ORM\Column(type: 'string', length: 255)]
private $fonction;
#[ORM\OneToMany(mappedBy: 'conseiller', targetEntity: RapportEvaluation::class)]
private Collection $rapportEvaluations;
public function __construct()
{
parent::__construct();
$this->rapportEvaluations = new ArrayCollection();
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getPrenom(): ?string
{
return $this->prenom;
}
public function setPrenom(string $prenom): self
{
$this->prenom = $prenom;
return $this;
}
public function getTel(): ?string
{
return $this->tel;
}
public function setTel(string $tel): self
{
$this->tel = $tel;
return $this;
}
public function getNomAdministration(): ?string
{
return $this->nom_administration;
}
public function setNomAdministration(string $nom_administration): self
{
$this->nom_administration = $nom_administration;
return $this;
}
public function getFonction(): ?string
{
return $this->fonction;
}
public function setFonction(string $fonction): self
{
$this->fonction = $fonction;
return $this;
}
public function getRegional(): ?string
{
return $this->regional;
}
public function setRegional(string $regional): self
{
$this->regional = $regional;
return $this;
}
public function getUnite(): ?string
{
return $this->unite;
}
public function setUnite(string $unite): self
{
$this->unite = $unite;
return $this;
}
public function __toString()
{
return 'Central' === $this->getRegional() ? $this->getPrenom() . ' ' . $this->getNom() . ' (Centrale)' : $this->getPrenom() . ' ' . $this->getNom() . ' (' . $this->getUnite() . ')';
}
/**
* @return Collection<int, RapportEvaluation>
*/
public function getRapportEvaluations(): Collection
{
return $this->rapportEvaluations;
}
public function addRapportEvaluation(RapportEvaluation $rapportEvaluation): self
{
if (!$this->rapportEvaluations->contains($rapportEvaluation)) {
$this->rapportEvaluations->add($rapportEvaluation);
$rapportEvaluation->setConseiller($this);
}
return $this;
}
public function removeRapportEvaluation(RapportEvaluation $rapportEvaluation): self
{
if ($this->rapportEvaluations->removeElement($rapportEvaluation)) {
// set the owning side to null (unless already changed)
if ($rapportEvaluation->getConseiller() === $this) {
$rapportEvaluation->setConseiller(null);
}
}
return $this;
}
}