src/Entity/Administrateurs.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AdministrateursRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity
  9.  */
  10. #[ORM\Entity(repositoryClassAdministrateursRepository::class)]
  11. class Administrateurs extends User
  12. {
  13.     // #[ORM\Id]
  14.     // #[ORM\GeneratedValue]
  15.     // #[ORM\Column(type: 'integer')]
  16.     // private $id;
  17.     #[ORM\Column(type'string'length50)]
  18.     private $nom_admin;
  19.     #[ORM\Column(type'string'length50)]
  20.     private $prenom_admin;
  21.     #[ORM\Column(type'boolean')]
  22.     private $sous_admin;
  23.     #[ORM\Column(type'blob'nullabletrue)]
  24.     private $photo;
  25.     #[ORM\Column(type'float'nullabletrue)]
  26.     private $taux_commission;
  27.     #[ORM\Column(type'float'nullabletrue)]
  28.     private $taux_esn;
  29.     #[ORM\ManyToMany(targetEntityServices::class, inversedBy'administrateurs')]
  30.     private $service;
  31.     public function __construct()
  32.     {
  33.         $this->service = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return parent::getId(); // Hérite de User
  38.     }
  39.     public function getNomAdmin(): ?string
  40.     {
  41.         return $this->nom_admin;
  42.     }
  43.     public function setNomAdmin(string $nom_admin): self
  44.     {
  45.         $this->nom_admin $nom_admin;
  46.         return $this;
  47.     }
  48.     public function getPrenomAdmin(): ?string
  49.     {
  50.         return $this->prenom_admin;
  51.     }
  52.     public function setPrenomAdmin(string $prenom_admin): self
  53.     {
  54.         $this->prenom_admin $prenom_admin;
  55.         return $this;
  56.     }
  57.     public function isSousAdmin(): ?bool
  58.     {
  59.         return $this->sous_admin;
  60.     }
  61.     public function setSousAdmin(bool $sous_admin): self
  62.     {
  63.         $this->sous_admin $sous_admin;
  64.         return $this;
  65.     }
  66.     public function getPhoto()
  67.     {
  68.         return $this->photo;
  69.     }
  70.     public function setPhoto($photo): self
  71.     {
  72.         $this->photo $photo;
  73.         return $this;
  74.     }
  75.     public function getTauxCommission(): ?float
  76.     {
  77.         return $this->taux_commission;
  78.     }
  79.     public function setTauxCommission(?float $taux_commission): self
  80.     {
  81.         $this->taux_commission $taux_commission;
  82.         return $this;
  83.     }
  84.     public function getTauxEsn(): ?float
  85.     {
  86.         return $this->taux_esn;
  87.     }
  88.     public function setTauxEsn(?float $taux_esn): self
  89.     {
  90.         $this->taux_esn $taux_esn;
  91.         return $this;
  92.     }
  93.     /**
  94.      * @return Collection<int, Services>
  95.      */
  96.     public function getService(): Collection
  97.     {
  98.         return $this->service;
  99.     }
  100.     public function addService(Services $service): self
  101.     {
  102.         if (!$this->service->contains($service)) {
  103.             $this->service[] = $service;
  104.         }
  105.         return $this;
  106.     }
  107.     public function removeService(Services $service): self
  108.     {
  109.         $this->service->removeElement($service);
  110.         return $this;
  111.     }
  112. }