<?phpnamespace App\Entity;use App\Repository\DepartementRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=DepartementRepository::class) */class Departement{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\OneToMany(targetEntity=Demande::class, mappedBy="id_departement") */ private $demandes; /** * @ORM\Column(type="string", length=255) */ private $Name; /** * @ORM\Column(type="string", length=255) */ private $Description; /** * @ORM\OneToMany(targetEntity=Utilisateur::class, mappedBy="departement") */ private $utilisateurs; public function __construct() { $this->demandes = new ArrayCollection(); $this->utilisateurs = new ArrayCollection(); } public function getId(): ?int { return $this->id; } /** * @return Collection|Demande[] */ public function getDemandes(): Collection { return $this->demandes; } public function addDemande(Demande $demande): self { if (!$this->demandes->contains($demande)) { $this->demandes[] = $demande; $demande->setIdDepartement($this); } return $this; } public function removeDemande(Demande $demande): self { if ($this->demandes->contains($demande)) { $this->demandes->removeElement($demande); // set the owning side to null (unless already changed) if ($demande->getIdDepartement() === $this) { $demande->setIdDepartement(null); } } return $this; } public function getName(): ?string { return $this->Name; } public function setName(string $Name): self { $this->Name = $Name; return $this; } public function getDescription(): ?string { return $this->Description; } public function setDescription(string $Description): self { $this->Description = $Description; return $this; } /** * @return Collection|Utilisateur[] */ public function getUtilisateurs(): Collection { return $this->utilisateurs; } public function addUtilisateur(Utilisateur $utilisateur): self { if (!$this->utilisateurs->contains($utilisateur)) { $this->utilisateurs[] = $utilisateur; $utilisateur->setDepartement($this); } return $this; } public function removeUtilisateur(Utilisateur $utilisateur): self { if ($this->utilisateurs->contains($utilisateur)) { $this->utilisateurs->removeElement($utilisateur); // set the owning side to null (unless already changed) if ($utilisateur->getDepartement() === $this) { $utilisateur->setDepartement(null); } } return $this; }}