src/Entity/Proposition.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PropositionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassPropositionRepository::class)]
  9. class Proposition
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\Column(type'datetime'nullabletrue)]
  16.     private $dateDemande;
  17.     #[ORM\Column(type'datetime'nullabletrue)]
  18.     private $dateEnvoi;
  19.     #[ORM\Column(type'datetime'nullabletrue)]
  20.     private $dateValidite;
  21.     #[ORM\Column(type'decimal'precision12scale2nullabletrue)]
  22.     private $montantHT;
  23.     #[ORM\Column(type'text'nullabletrue)]
  24.     private $remarques;
  25.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'propositions'fetch'EAGER'cascade: ['persist'])]
  26.     private ?User $auteur;
  27.     #[ORM\ManyToOne(targetEntityPropositionOrigine::class, inversedBy'propositions'fetch'EAGER'cascade: ['persist'])]
  28.     private ?PropositionOrigine $origine;
  29.     #[ORM\ManyToOne(targetEntityAffaire::class, inversedBy'propositions'cascade: ['persist'])]
  30.     private $affaire;
  31.     #[ORM\OneToOne(targetEntityFacture::class, mappedBy'proposition'cascade: ['persist'])]
  32.     private $facture;
  33.     #[ORM\Column(type'integer'nullabletrue)]
  34.     private $version 1;
  35.     #[ORM\Column(type'boolean'nullabletrue)]
  36.     private $valide;
  37.     #[ORM\ManyToOne(targetEntityCategorieAffaire::class, inversedBy'affaires'cascade: ['persist'])]
  38.     #[ORM\JoinColumn(nullabletrue)]
  39.     private ?CategorieAffaire $categorie null;
  40.     #[ORM\Column(type'string'length255nullabletrue)]
  41.     private $objet;
  42.     #[ORM\OneToMany(targetEntityCommandeProposition::class, mappedBy'proposition'cascade: ['all'])]
  43.     private $commandes;
  44.     #[ORM\OneToMany(targetEntityFactureProposition::class, mappedBy'proposition'cascade: ['all'])]
  45.     private $factures;
  46.     #[ORM\Column(type'text'nullabletrue)]
  47.     private $exigences;
  48.     #[ORM\Column(type'string'length255nullabletrue)]
  49.     private $avancement "Préparation devis";
  50.     public function __construct()
  51.     {
  52.         $this->commandes = new ArrayCollection();
  53.         $this->factures = new ArrayCollection();
  54.     }
  55.     public function __toString()
  56.     {
  57. //        return "Proposition n° " . $this->getId() . ' - '. $this->getAvancement();
  58. //        return $this->getObjet() . ' - '. $this->getCategorie() . htmlentities(' <span>'.$this->getAvancement().'</span>');
  59. //        return $this->getObjet() . ' - '. $this->getCategorie();
  60.         return $this->getObjet() . ' - '$this->getCategorie() . ' - ' $this->getAvancement() ;
  61.     }
  62. //
  63. //    public function getFullLabel()
  64. //    {
  65. //        return "Proposition n° " . $this->getId() . ' - '. $this->getAvancement();
  66. ////        return $this->getObjet() . ' - '. $this->getCategorie() . htmlentities(' <span>'.$this->getAvancement().'</span>');
  67. ////        return $this->getObjet() . ' - '. $this->getCategorie();
  68. //    }
  69.     public function setCommandes(?Collection $commandes): self
  70.     {
  71.         $this->commandes $commandes;
  72.         return $this;
  73.     }
  74.     public function setFactures(?Collection $factures): self
  75.     {
  76.         $this->factures $factures;
  77.         return $this;
  78.     }
  79.     public function getId(): ?int
  80.     {
  81.         return $this->id;
  82.     }
  83.     public function getDateDemande(): ?\DateTimeInterface
  84.     {
  85.         return $this->dateDemande;
  86.     }
  87.     public function setDateDemande(?\DateTimeInterface $dateDemande): self
  88.     {
  89.         $this->dateDemande $dateDemande;
  90.         return $this;
  91.     }
  92.     public function getDateEnvoi(): ?\DateTimeInterface
  93.     {
  94.         return $this->dateEnvoi;
  95.     }
  96.     public function setDateEnvoi(?\DateTimeInterface $dateEnvoi): self
  97.     {
  98.         $this->dateEnvoi $dateEnvoi;
  99.         return $this;
  100.     }
  101.     public function getDateValidite(): ?\DateTimeInterface
  102.     {
  103.         return $this->dateValidite;
  104.     }
  105.     public function setDateValidite(?\DateTimeInterface $dateValidite): self
  106.     {
  107.         $this->dateValidite $dateValidite;
  108.         return $this;
  109.     }
  110.     public function getMontantHT(): ?string
  111.     {
  112.         return $this->montantHT;
  113.     }
  114.     public function setMontantHT(?string $montantHT): self
  115.     {
  116.         $this->montantHT $montantHT;
  117.         return $this;
  118.     }
  119.     public function getRemarques(): ?string
  120.     {
  121.         return $this->remarques;
  122.     }
  123.     public function setRemarques(?string $remarques): self
  124.     {
  125.         $this->remarques $remarques;
  126.         return $this;
  127.     }
  128.     public function getVersion(): ?int
  129.     {
  130.         return $this->version;
  131.     }
  132.     public function setVersion(?int $version): self
  133.     {
  134.         $this->version $version;
  135.         return $this;
  136.     }
  137.     public function isValide(): ?bool
  138.     {
  139.         return $this->valide;
  140.     }
  141.     public function setValide(?bool $valide): self
  142.     {
  143.         $this->valide $valide;
  144.         return $this;
  145.     }
  146.     public function getObjet(): ?string
  147.     {
  148.         return $this->objet;
  149.     }
  150.     public function setObjet(?string $objet): self
  151.     {
  152.         $this->objet $objet;
  153.         return $this;
  154.     }
  155.     public function getAuteur(): ?User
  156.     {
  157.         return $this->auteur;
  158.     }
  159.     public function setAuteur(?User $auteur): self
  160.     {
  161.         $this->auteur $auteur;
  162.         return $this;
  163.     }
  164.     public function getOrigine(): ?PropositionOrigine
  165.     {
  166.         return $this->origine;
  167.     }
  168.     public function setOrigine(?PropositionOrigine $origine): self
  169.     {
  170.         $this->origine $origine;
  171.         return $this;
  172.     }
  173.     public function getAffaire(): ?Affaire
  174.     {
  175.         return $this->affaire;
  176.     }
  177.     public function setAffaire(?Affaire $affaire): self
  178.     {
  179.         $this->affaire $affaire;
  180.         return $this;
  181.     }
  182.     public function getFacture(): ?Facture
  183.     {
  184.         return $this->facture;
  185.     }
  186.     public function setFacture(?Facture $facture): self
  187.     {
  188.         // unset the owning side of the relation if necessary
  189.         if ($facture === null && $this->facture !== null) {
  190.             $this->facture->setProposition(null);
  191.         }
  192.         // set the owning side of the relation if necessary
  193.         if ($facture !== null && $facture->getProposition() !== $this) {
  194.             $facture->setProposition($this);
  195.         }
  196.         $this->facture $facture;
  197.         return $this;
  198.     }
  199.     public function getCategorie(): ?CategorieAffaire
  200.     {
  201.         return $this->categorie;
  202.     }
  203.     public function setCategorie(?CategorieAffaire $categorie): self
  204.     {
  205.         $this->categorie $categorie;
  206.         return $this;
  207.     }
  208.     /**
  209.      * @return Collection<int, CommandeProposition>
  210.      */
  211.     public function getCommandes(): Collection
  212.     {
  213.         return $this->commandes;
  214.     }
  215.     public function addCommande(CommandeProposition $commande): self
  216.     {
  217.         if (!$this->commandes->contains($commande)) {
  218.             $this->commandes->add($commande);
  219.             $this->commandes[] = $commande;
  220.             $commande->setProposition($this);
  221.         }
  222.         return $this;
  223.     }
  224.     public function removeCommande(CommandeProposition $commande): self
  225.     {
  226.         if ($this->commandes->removeElement($commande)) {
  227.             // set the owning side to null (unless already changed)
  228.             if ($commande->getProposition() === $this) {
  229.                 $commande->setProposition(null);
  230.             }
  231.         }
  232.         return $this;
  233.     }
  234.     /**
  235.      * @return Collection<int, FactureProposition>
  236.      */
  237.     public function getFactures(): Collection
  238.     {
  239.         return $this->factures;
  240.     }
  241.     public function addFacture(FactureProposition $facture): self
  242.     {
  243.         if (!$this->factures->contains($facture)) {
  244. //            $this->factures->add($facture);
  245.             $this->factures[] = $facture;
  246.             $facture->setProposition($this);
  247.         }
  248.         return $this;
  249.     }
  250.     public function removeFacture(FactureProposition $facture): self
  251.     {
  252.         if ($this->factures->removeElement($facture)) {
  253.             // set the owning side to null (unless already changed)
  254.             if ($facture->getProposition() === $this) {
  255.                 $facture->setProposition(null);
  256.             }
  257.         }
  258.         return $this;
  259.     }
  260.     public function getExigences(): ?string
  261.     {
  262.         return $this->exigences;
  263.     }
  264.     public function setExigences(?string $exigences): self
  265.     {
  266.         $this->exigences $exigences;
  267.         return $this;
  268.     }
  269.     /**
  270.      * @return mixed
  271.      */
  272.     public function getAvancement()
  273.     {
  274.         return $this->avancement;
  275.     }
  276.     /**
  277.      * @param mixed $avancement
  278.      */
  279.     public function setAvancement($avancement): void
  280.     {
  281.         $this->avancement $avancement;
  282.     }
  283.     
  284. }