<?php
namespace App\Entity;
use App\Repository\AffaireRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AffaireRepository::class)]
class Affaire
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $numeroAffaire;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $site;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $siteContact;
#[ORM\Column(type: 'text', nullable: true)]
private $siteAdresse;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $siteCodePostal;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $siteVille;
#[ORM\Column(type: 'text', nullable: true)]
private $exigences;
#[ORM\Column(type: 'text', nullable: true)]
private $retourExp;
#[ORM\Column(type: 'text', nullable: true)]
private $remarques;
#[ORM\ManyToOne(targetEntity: CategorieAffaire::class, inversedBy: 'affaires', cascade: ['persist'])]
private $categorie;
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'affaires', cascade: ['persist'])]
private $responsable;
#[ORM\ManyToOne(targetEntity: Client::class, inversedBy: 'affaires', cascade: ['persist'])]
private $client;
#[ORM\OneToMany(targetEntity: Proposition::class, mappedBy: 'affaire', cascade: ['persist', 'remove'])]
private $propositions;
#[ORM\OneToMany(targetEntity: Dossier::class, mappedBy: 'affaire', cascade: ['persist', 'remove'])]
private $dossiers;
#[ORM\OneToMany(targetEntity: Courrier::class, mappedBy: 'affaire', cascade: ['persist', 'remove'])]
private $courriers;
#[ORM\Column(type: 'datetime', nullable: true)]
private $createdAt;
#[ORM\Column(type: 'datetime', nullable: true)]
private $updatedAt;
#[ORM\OneToMany(targetEntity: Commande::class, mappedBy: 'affaire', cascade: ['persist', 'remove'])]
private $commandes;
#[ORM\OneToMany(targetEntity: Facture::class, mappedBy: 'affaire', cascade: ['persist', 'remove'])]
private $factures;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $objet;
#[ORM\Column(type: 'boolean', nullable: true)]
private $isDeleted;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $siteContactTel;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $siteContactMail;
#[ORM\ManyToOne(targetEntity: Agence::class, cascade: ['persist'])]
private $agence;
private $proposition1;
private $proposition2;
private bool $copyClientSite;
private bool $duplicate = false;
/**
* @return mixed
*/
public function getProposition1()
{
return $this->proposition1;
}
/**
* @param mixed $proposition1
*/
public function setProposition1($proposition1): void
{
$this->proposition1 = $proposition1;
}
/**
* @return mixed
*/
public function getProposition2()
{
return $this->proposition2;
}
/**
* @param mixed $proposition2
*/
public function setProposition2($proposition2): void
{
$this->proposition2 = $proposition2;
}
/**
* @return bool
*/
public function isCopyClientSite(): bool
{
return $this->copyClientSite;
}
/**
* @param bool $copyClientSite
*/
public function setCopyClientSite(bool $copyClientSite): void
{
$this->copyClientSite = $copyClientSite;
}
/**
* @return bool
*/
public function isDuplicate(): bool
{
return $this->duplicate;
}
/**
* @param bool $duplicate
*/
public function setDuplicate(bool $duplicate): void
{
$this->duplicate = $duplicate;
}
public function __toString()
{
return $this->getNumeroAffaire();
}
public function __construct()
{
$this->propositions = new ArrayCollection();
$this->dossiers = new ArrayCollection();
$this->courriers = new ArrayCollection();
$this->commandes = new ArrayCollection();
$this->factures = new ArrayCollection();
$this->setNumeroAffaire("Généré");
$this->setProposition1("Prop 1");
$this->setProposition2("Prop 2");
}
public function getId(): ?int
{
return $this->id;
}
public function getNumeroAffaire(): ?string
{
return $this->numeroAffaire;
}
public function setNumeroAffaire(?string $numeroAffaire): self
{
$this->numeroAffaire = $numeroAffaire;
return $this;
}
public function getSite(): ?string
{
return $this->site;
}
public function setSite(?string $site): self
{
$this->site = $site;
return $this;
}
public function getSiteContact(): ?string
{
return $this->siteContact;
}
public function setSiteContact(?string $siteContact): self
{
$this->siteContact = $siteContact;
return $this;
}
public function getSiteAdresse(): ?string
{
return $this->siteAdresse;
}
public function setSiteAdresse(?string $siteAdresse): self
{
$this->siteAdresse = $siteAdresse;
return $this;
}
public function getSiteCodePostal(): ?string
{
return $this->siteCodePostal;
}
public function setSiteCodePostal(?string $siteCodePostal): self
{
$this->siteCodePostal = $siteCodePostal;
return $this;
}
public function getSiteVille(): ?string
{
return $this->siteVille;
}
public function setSiteVille(?string $siteVille): self
{
$this->siteVille = $siteVille;
return $this;
}
public function getExigences(): ?string
{
return $this->exigences;
}
public function setExigences(?string $exigences): self
{
$this->exigences = $exigences;
return $this;
}
public function getRetourExp(): ?string
{
return $this->retourExp;
}
public function setRetourExp(?string $retourExp): self
{
$this->retourExp = $retourExp;
return $this;
}
public function getRemarques(): ?string
{
return $this->remarques;
}
public function setRemarques(?string $remarques): self
{
$this->remarques = $remarques;
return $this;
}
public function getCategorie(): ?CategorieAffaire
{
return $this->categorie;
}
public function setCategorie(?CategorieAffaire $categorie): self
{
$this->categorie = $categorie;
return $this;
}
public function getResponsable(): ?User
{
return $this->responsable;
}
public function setResponsable(?User $responsable): self
{
$this->responsable = $responsable;
return $this;
}
public function getClient(): ?Client
{
return $this->client;
}
public function setClient(?Client $client): self
{
$this->client = $client;
return $this;
}
/**
* @return Collection|Proposition[]
*/
public function getPropositions(): Collection
{
return $this->propositions;
}
public function addProposition(Proposition $proposition): self
{
if (!$this->propositions->contains($proposition)) {
$this->propositions[] = $proposition;
$proposition->setAffaire($this);
}
return $this;
}
public function removeProposition(Proposition $proposition): self
{
if ($this->propositions->removeElement($proposition)) {
// set the owning side to null (unless already changed)
if ($proposition->getAffaire() === $this) {
$proposition->setAffaire(null);
}
}
return $this;
}
/**
* @return Collection|Dossier[]
*/
public function getDossiers(): Collection
{
return $this->dossiers;
}
public function addDossier(Dossier $dossier): self
{
if (!$this->dossiers->contains($dossier)) {
$this->dossiers[] = $dossier;
$dossier->setAffaire($this);
}
return $this;
}
public function removeDossier(Dossier $dossier): self
{
if ($this->dossiers->removeElement($dossier)) {
// set the owning side to null (unless already changed)
if ($dossier->getAffaire() === $this) {
$dossier->setAffaire(null);
}
}
return $this;
}
/**
* @return Collection|Courrier[]
*/
public function getCourriers(): Collection
{
return $this->courriers;
}
public function addCourrier(Courrier $courrier): self
{
if (!$this->courriers->contains($courrier)) {
$this->courriers[] = $courrier;
$courrier->setAffaire($this);
}
return $this;
}
public function removeCourrier(Courrier $courrier): self
{
if ($this->courriers->removeElement($courrier)) {
// set the owning side to null (unless already changed)
if ($courrier->getAffaire() === $this) {
$courrier->setAffaire(null);
}
}
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @return Collection|Commande[]
*/
public function getCommandes(): Collection
{
return $this->commandes;
}
public function addCommande(Commande $commande): self
{
if (!$this->commandes->contains($commande)) {
$this->commandes[] = $commande;
$commande->setAffaire($this);
}
return $this;
}
public function removeCommande(Commande $commande): self
{
if ($this->commandes->removeElement($commande)) {
// set the owning side to null (unless already changed)
if ($commande->getAffaire() === $this) {
$commande->setAffaire(null);
}
}
return $this;
}
/**
* @return Collection|Facture[]
*/
public function getFactures(): Collection
{
return $this->factures;
}
public function addFacture(Facture $facture): self
{
if (!$this->factures->contains($facture)) {
$this->factures[] = $facture;
$facture->setAffaire($this);
}
return $this;
}
public function removeFacture(Facture $facture): self
{
if ($this->factures->removeElement($facture)) {
// set the owning side to null (unless already changed)
if ($facture->getAffaire() === $this) {
$facture->setAffaire(null);
}
}
return $this;
}
public function getObjet(): ?string
{
return $this->objet;
}
public function setObjet(?string $objet): self
{
$this->objet = $objet;
return $this;
}
public function getIsDeleted(): ?bool
{
return $this->isDeleted;
}
public function setIsDeleted(?bool $isDeleted): self
{
$this->isDeleted = $isDeleted;
return $this;
}
public function getSiteContactTel(): ?string
{
return $this->siteContactTel;
}
public function setSiteContactTel(?string $siteContactTel): self
{
$this->siteContactTel = $siteContactTel;
return $this;
}
public function getSiteContactMail(): ?string
{
return $this->siteContactMail;
}
public function setSiteContactMail(?string $siteContactMail): self
{
$this->siteContactMail = $siteContactMail;
return $this;
}
public function getAgence(): ?Agence
{
return $this->agence;
}
public function setAgence(?Agence $agence): self
{
$this->agence = $agence;
return $this;
}
}