<?php
namespace App\Entity;
use App\Repository\ComerciauxRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
#[ORM\Entity(repositoryClass: ComerciauxRepository::class)]
class Comerciaux extends User
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 50)]
private $nom_C;
#[ORM\Column(type: 'string', length: 50)]
private $prenom_C;
#[ORM\Column(type: 'string', length: 50)]
private $fonction_C;
#[ORM\Column(type: 'blob', nullable: true)]
private $photo;
#[ORM\OneToMany(mappedBy: 'commercial', targetEntity: EvaluationCOM::class)]
private $evaluationCOMs;
#[ORM\OneToMany(mappedBy: 'comercial', targetEntity: AvisComerciaux::class)]
private $avisComerciauxes;
#[ORM\ManyToOne(targetEntity: Entreprises::class, inversedBy: 'comerciauxes')]
private $entreprise;
public function __construct()
{
$this->evaluationCOMs = new ArrayCollection();
$this->avisComerciauxes = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNomC(): ?string
{
return $this->nom_C;
}
public function setNomC(string $nom_C): self
{
$this->nom_C = $nom_C;
return $this;
}
public function getPrenomC(): ?string
{
return $this->prenom_C;
}
public function setPrenomC(string $prenom_C): self
{
$this->prenom_C = $prenom_C;
return $this;
}
public function getFonctionC(): ?string
{
return $this->fonction_C;
}
public function setFonctionC(string $fonction): self
{
$this->fonction_C = $fonction;
return $this;
}
public function getPhoto()
{
return $this->photo;
}
public function setPhoto($photo): self
{
$this->photo = $photo;
return $this;
}
/**
* @return Collection<int, EvaluationCOM>
*/
public function getEvaluationCOMs(): Collection
{
return $this->evaluationCOMs;
}
public function addEvaluationCOM(EvaluationCOM $evaluationCOM): self
{
if (!$this->evaluationCOMs->contains($evaluationCOM)) {
$this->evaluationCOMs[] = $evaluationCOM;
$evaluationCOM->setCommercial($this);
}
return $this;
}
public function removeEvaluationCOM(EvaluationCOM $evaluationCOM): self
{
if ($this->evaluationCOMs->removeElement($evaluationCOM)) {
// set the owning side to null (unless already changed)
if ($evaluationCOM->getCommercial() === $this) {
$evaluationCOM->setCommercial(null);
}
}
return $this;
}
/**
* @return Collection<int, AvisComerciaux>
*/
public function getAvisComerciauxes(): Collection
{
return $this->avisComerciauxes;
}
public function addAvisComerciaux(AvisComerciaux $avisComerciaux): self
{
if (!$this->avisComerciauxes->contains($avisComerciaux)) {
$this->avisComerciauxes[] = $avisComerciaux;
$avisComerciaux->setComercial($this);
}
return $this;
}
public function removeAvisComerciaux(AvisComerciaux $avisComerciaux): self
{
if ($this->avisComerciauxes->removeElement($avisComerciaux)) {
// set the owning side to null (unless already changed)
if ($avisComerciaux->getComercial() === $this) {
$avisComerciaux->setComercial(null);
}
}
return $this;
}
public function getEntreprise(): ?Entreprises
{
return $this->entreprise;
}
public function setEntreprise(?Entreprises $entreprise): self
{
$this->entreprise = $entreprise;
return $this;
}
}