<?php
namespace App\Entity;
use App\Repository\AdministrateursRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
#[ORM\Entity(repositoryClass: AdministrateursRepository::class)]
class Administrateurs extends User
{
// #[ORM\Id]
// #[ORM\GeneratedValue]
// #[ORM\Column(type: 'integer')]
// private $id;
#[ORM\Column(type: 'string', length: 50)]
private $nom_admin;
#[ORM\Column(type: 'string', length: 50)]
private $prenom_admin;
#[ORM\Column(type: 'boolean')]
private $sous_admin;
#[ORM\Column(type: 'blob', nullable: true)]
private $photo;
#[ORM\Column(type: 'float', nullable: true)]
private $taux_commission;
#[ORM\Column(type: 'float', nullable: true)]
private $taux_esn;
#[ORM\ManyToMany(targetEntity: Services::class, inversedBy: 'administrateurs')]
private $service;
public function __construct()
{
$this->service = new ArrayCollection();
}
public function getId(): ?int
{
return parent::getId(); // Hérite de User
}
public function getNomAdmin(): ?string
{
return $this->nom_admin;
}
public function setNomAdmin(string $nom_admin): self
{
$this->nom_admin = $nom_admin;
return $this;
}
public function getPrenomAdmin(): ?string
{
return $this->prenom_admin;
}
public function setPrenomAdmin(string $prenom_admin): self
{
$this->prenom_admin = $prenom_admin;
return $this;
}
public function isSousAdmin(): ?bool
{
return $this->sous_admin;
}
public function setSousAdmin(bool $sous_admin): self
{
$this->sous_admin = $sous_admin;
return $this;
}
public function getPhoto()
{
return $this->photo;
}
public function setPhoto($photo): self
{
$this->photo = $photo;
return $this;
}
public function getTauxCommission(): ?float
{
return $this->taux_commission;
}
public function setTauxCommission(?float $taux_commission): self
{
$this->taux_commission = $taux_commission;
return $this;
}
public function getTauxEsn(): ?float
{
return $this->taux_esn;
}
public function setTauxEsn(?float $taux_esn): self
{
$this->taux_esn = $taux_esn;
return $this;
}
/**
* @return Collection<int, Services>
*/
public function getService(): Collection
{
return $this->service;
}
public function addService(Services $service): self
{
if (!$this->service->contains($service)) {
$this->service[] = $service;
}
return $this;
}
public function removeService(Services $service): self
{
$this->service->removeElement($service);
return $this;
}
}