src/Entity/Chantier.php line 13

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ChantierRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use phpDocumentor\Reflection\Types\Nullable;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. #[ORM\Entity(repositoryClass: ChantierRepository::class)]
  10. class Chantier
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id = null;
  16.     #[ORM\Column(length: 50)]
  17.     private ?string $nom = null;
  18.     #[ORM\Column( nullable: true)]
  19.     private ?int $metrage = null;
  20.     #[ORM\Column(length: 50 , nullable: true)]
  21.     #[Assert\Regex(pattern:"/^R+[0-9]{1}$/")]
  22.     private ?string $raidechausse = null;
  23.     #[ORM\ManyToOne(inversedBy: 'chantiers')]
  24.     private ?TypeChantier $type = null;
  25.     #[ORM\ManyToOne(inversedBy: 'chantiers')]
  26.     private ?Commercial $commercial = null;
  27.     #[ORM\OneToMany(mappedBy: 'chantier', targetEntity: Visite::class,cascade: ["persist"])]
  28.     private Collection $visite;
  29.     #[ORM\ManyToMany(targetEntity: Intervenant::class, inversedBy: 'chantiers')]
  30.     private Collection $intervenant;
  31.     #[ORM\ManyToOne(inversedBy: 'chantiers')]
  32.     private ?NatureChantier $nature = null;
  33.     #[ORM\Column(length: 50, nullable: true)]
  34.     private ?string $planDaction = null;
  35.     #[ORM\OneToMany(mappedBy: 'chantier', targetEntity: Tache::class)]
  36.     private Collection $tache;
  37.     #[ORM\Column(nullable: true)]
  38.     private ?int $nombreVisite = null;
  39.     #[ORM\ManyToMany(targetEntity: Directeur::class, inversedBy: 'chantiers')]
  40.     private Collection $directeur;
  41.     #[ORM\ManyToOne(inversedBy: 'chantiers')]
  42.     private ?Zone $zone = null;   
  43.     #[ORM\Column(length: 255, nullable: true)]
  44.     private ?string $latitude = null;
  45.     #[ORM\Column(length: 255, nullable: true)]
  46.     private ?string $longitude = null;
  47.     #[ORM\Column(length: 50,nullable: true)]
  48.     private ?string $revendeur = null;
  49.     #[ORM\Column(length: 50, nullable: true)]
  50.     private ?string $architect = null;
  51.     #[ORM\Column(length: 50, nullable: true)]
  52.     private ?string $pi = null;
  53.     #[ORM\OneToMany(mappedBy: 'chantier', targetEntity: ProductMetrage::class)]
  54.     private Collection $productMetrages;
  55.     #[ORM\OneToMany(mappedBy: 'chantier', targetEntity: ChantierProduit::class)]
  56.     private Collection $chantierProduits;
  57.     #[ORM\Column(length: 255, nullable: true)]
  58.     private ?string $demande = null;
  59.     #[ORM\ManyToOne(inversedBy: 'direction')]
  60.     private ?Directeur $direction = null;
  61.     #[ORM\Column(type: 'datetime', nullable: true)]
  62.     private ?\DateTimeInterface $dateModification = null;
  63.     #[ORM\Column(length: 255, nullable: true)]
  64.     private ?string $egc = null;
  65.     #[ORM\Column(length: 255, nullable: true)]
  66.     private ?string $valeur = null;
  67.     #[ORM\Column(length: 255, nullable: true)]
  68.     private ?string $budgetrev = null;
  69.     #[ORM\Column(length: 255, nullable: true)]
  70.     private ?string $typerev = null;
  71.     #[ORM\OneToMany(mappedBy: 'chantier', targetEntity: ChantierProduct::class)]
  72.     private Collection $chantierProducts;
  73.     #[ORM\Column(length: 255, nullable: true)]
  74.     private ?string $products = null;
  75.     #[ORM\Column(length: 255, nullable: true)]
  76.     private ?string $concurrent = null;
  77.     #[ORM\Column(length: 255, nullable: true)]
  78.     private ?string $mcarre = null;
  79.     #[ORM\Column(length: 255, nullable: true)]
  80.     private ?string $vglobal = null;
  81.     #[ORM\Column(length: 255, nullable: true)]
  82.     private ?string $financement = null;
  83.     #[ORM\Column(length: 255, nullable: true)]
  84.     private ?string $datedebut = null;
  85.     #[ORM\ManyToOne(inversedBy: 'chantiers')]
  86.     private ?Revendeur $client = null;
  87.     #[ORM\Column(length: 255, nullable: true)]
  88.     private ?string $otherclient = null;
  89.     #[ORM\ManyToOne]
  90.     private ?Departement $departement = null;
  91.     #[ORM\Column(length: 255, nullable: true)]
  92.     private ?string $choix = null;
  93.    
  94.     public function __construct()
  95.     {
  96.         $this->visite = new ArrayCollection();
  97.         $this->intervenant = new ArrayCollection();
  98.         $this->tache = new ArrayCollection();
  99.         $this->directeur = new ArrayCollection();
  100.         $this->productMetrages = new ArrayCollection();
  101.         $this->chantierProduits = new ArrayCollection();
  102.         $this->chantierProducts = new ArrayCollection();
  103.         
  104.     }
  105.     public function getId(): ?int
  106.     {
  107.         return $this->id;
  108.     }
  109.     public function getNom(): ?string
  110.     {
  111.         return $this->nom;
  112.     }
  113.     public function setNom(string $nom): self
  114.     {
  115.         $this->nom = $nom;
  116.         return $this;
  117.     }
  118.     public function getMetrage(): ?int
  119.     {
  120.         return $this->metrage;
  121.     }
  122.     public function setMetrage(int $metrage): self
  123.     {
  124.         $this->metrage = $metrage;
  125.         return $this;
  126.     }
  127.     public function getRaidechausse(): ?string
  128.     {
  129.         return $this->raidechausse;
  130.     }
  131.     public function setRaidechausse(string $raidechausse): self
  132.     {
  133.         $this->raidechausse = $raidechausse;
  134.         return $this;
  135.     }
  136.     
  137.     public function getType(): ?TypeChantier
  138.     {
  139.         return $this->type;
  140.     }
  141.     public function setType(?TypeChantier $type): self
  142.     {
  143.         $this->type = $type;
  144.         return $this;
  145.     }
  146.     public function getCommercial(): ?Commercial
  147.     {
  148.         return $this->commercial;
  149.     }
  150.     public function setCommercial(?Commercial $commercial): self
  151.     {
  152.         $this->commercial = $commercial;
  153.         return $this;
  154.     }
  155.     /**
  156.      * @return Collection<int, Visite>
  157.      */
  158.     public function getVisite(): Collection
  159.     {
  160.         return $this->visite;
  161.     }
  162.     public function addVisite(Visite $visite): self
  163.     {
  164.         if (!$this->visite->contains($visite)) {
  165.             $this->visite->add($visite);
  166.             $visite->setChantier($this);
  167.         }
  168.         return $this;
  169.     }
  170.     public function removeVisite(Visite $visite): self
  171.     {
  172.         if ($this->visite->removeElement($visite)) {
  173.             // set the owning side to null (unless already changed)
  174.             if ($visite->getChantier() === $this) {
  175.                 $visite->setChantier(null);
  176.             }
  177.         }
  178.         return $this;
  179.     }
  180.     /**
  181.      * @return Collection<int, Intervenant>
  182.      */
  183.     public function getIntervenant(): Collection
  184.     {
  185.         return $this->intervenant;
  186.     }
  187.     public function addIntervenant(?Intervenant $intervenant): self
  188.     {
  189.     if ($intervenant !== null) {
  190.         if (!$this->intervenant->contains($intervenant)) {
  191.             $this->intervenant->add($intervenant);
  192.             $intervenant->addChantier($this);
  193.         }
  194.     }
  195.     return $this;
  196.    }
  197.     public function removeIntervenant(Intervenant $intervenant): self
  198.     {
  199.         $this->intervenant->removeElement($intervenant);
  200.         return $this;
  201.     }
  202.     public function getNature(): ?NatureChantier
  203.     {
  204.         return $this->nature;
  205.     }
  206.     public function setNature(?NatureChantier $nature): self
  207.     {
  208.         $this->nature = $nature;
  209.         return $this;
  210.     }
  211.     public function getPlanDaction(): ?string
  212.     {
  213.         return $this->planDaction;
  214.     }
  215.     public function setPlanDaction(?string $planDaction): self
  216.     {
  217.         $this->planDaction = $planDaction;
  218.         return $this;
  219.     }
  220.     /**
  221.      * @return Collection<int, Tache>
  222.      */
  223.     public function getTache(): Collection
  224.     {
  225.         return $this->tache;
  226.     }
  227.     public function addTache(Tache $tache): self
  228.     {
  229.         if (!$this->tache->contains($tache)) {
  230.             $this->tache->add($tache);
  231.             $tache->setChantier($this);
  232.         }
  233.         return $this;
  234.     }
  235.     public function removeTache(Tache $tache): self
  236.     {
  237.         if ($this->tache->removeElement($tache)) {
  238.             // set the owning side to null (unless already changed)
  239.             if ($tache->getChantier() === $this) {
  240.                 $tache->setChantier(null);
  241.             }
  242.         }
  243.         return $this;
  244.     }
  245.     public function getNombreVisite(): ?int
  246.     {
  247.         return $this->nombreVisite;
  248.     }
  249.     public function setNombreVisite(?int $nombreVisite): self
  250.     {
  251.         $this->nombreVisite = $nombreVisite;
  252.         return $this;
  253.     }
  254.     /**
  255.      * @return Collection<int, Directeur>
  256.      */
  257.     public function getDirecteur(): Collection
  258.     {
  259.         return $this->directeur;
  260.     }
  261.     public function addDirecteur(Directeur $directeur): self
  262.     {
  263.         if (!$this->directeur->contains($directeur)) {
  264.             $this->directeur->add($directeur);
  265.         }
  266.         return $this;
  267.     }
  268.     public function removeDirecteur(Directeur $directeur): self
  269.     {
  270.         $this->directeur->removeElement($directeur);
  271.         return $this;
  272.     }
  273.     public function getZone(): ?Zone
  274.     {
  275.         return $this->zone;
  276.     }
  277.     public function setZone(?Zone $zone): self
  278.     {
  279.         $this->zone = $zone;
  280.         return $this;
  281.     }
  282.     
  283.     public function getLatitude(): ?string
  284.     {
  285.         return $this->latitude;
  286.     }
  287.     public function setLatitude(?string $latitude): self
  288.     {
  289.         $this->latitude = $latitude;
  290.         return $this;
  291.     }
  292.     public function getLongitude(): ?string
  293.     {
  294.         return $this->longitude;
  295.     }
  296.     public function setLongitude(?string $longitude): self
  297.     {
  298.         $this->longitude = $longitude;
  299.         return $this;
  300.     }
  301.     public function getRevendeur(): ?string
  302.     {
  303.         return $this->revendeur;
  304.     }
  305.     public function setRevendeur(string $revendeur): self
  306.     {
  307.         $this->revendeur = $revendeur;
  308.         return $this;
  309.     }
  310.     public function getArchitect(): ?string
  311.     {
  312.         return $this->architect;
  313.     }
  314.     public function setArchitect(?string $architect): self
  315.     {
  316.         $this->architect = $architect;
  317.         return $this;
  318.     }
  319.     public function getPi(): ?string
  320.     {
  321.         return $this->pi;
  322.     }
  323.     public function setPi(?string $pi): self
  324.     {
  325.         $this->pi = $pi;
  326.         return $this;
  327.     }
  328.     /**
  329.      * @return Collection<int, ProductMetrage>
  330.      */
  331.     public function getProductMetrages(): Collection
  332.     {
  333.         return $this->productMetrages;
  334.     }
  335.     public function addProductMetrage(ProductMetrage $productMetrage): self
  336.     {
  337.         if (!$this->productMetrages->contains($productMetrage)) {
  338.             $this->productMetrages->add($productMetrage);
  339.             $productMetrage->setChantier($this);
  340.         }
  341.         return $this;
  342.     }
  343.     public function removeProductMetrage(ProductMetrage $productMetrage): self
  344.     {
  345.         if ($this->productMetrages->removeElement($productMetrage)) {
  346.             // set the owning side to null (unless already changed)
  347.             if ($productMetrage->getChantier() === $this) {
  348.                 $productMetrage->setChantier(null);
  349.             }
  350.         }
  351.         return $this;
  352.     }
  353.     /**
  354.      * @return Collection<int, ChantierProduit>
  355.      */
  356.     public function getChantierProduits(): Collection
  357.     {
  358.         return $this->chantierProduits;
  359.     }
  360.     public function addChantierProduit(ChantierProduit $chantierProduit): self
  361.     {
  362.         if (!$this->chantierProduits->contains($chantierProduit)) {
  363.             $this->chantierProduits->add($chantierProduit);
  364.             $chantierProduit->setChantier($this);
  365.         }
  366.         return $this;
  367.     }
  368.     public function removeChantierProduit(ChantierProduit $chantierProduit): self
  369.     {
  370.         if ($this->chantierProduits->removeElement($chantierProduit)) {
  371.             // set the owning side to null (unless already changed)
  372.             if ($chantierProduit->getChantier() === $this) {
  373.                 $chantierProduit->setChantier(null);
  374.             }
  375.         }
  376.         return $this;
  377.     }
  378.     public function getDemande(): ?string
  379.     {
  380.         return $this->demande;
  381.     }
  382.     public function setDemande(?string $demande): self
  383.     {
  384.         $this->demande = $demande;
  385.         return $this;
  386.     }
  387.     public function getDirection(): ?Directeur
  388.     {
  389.         return $this->direction;
  390.     }
  391.     public function setDirection(?Directeur $direction): self
  392.     {
  393.         $this->direction = $direction;
  394.         return $this;
  395.     }
  396.     
  397.     public function getDateModification(): ?\DateTimeInterface
  398.     {
  399.         return $this->dateModification;
  400.     }
  401.     public function setDateModification(?\DateTimeInterface $dateModification): self
  402.     {
  403.         $this->dateModification = $dateModification;
  404.         return $this;
  405.     }
  406.     public function getEgc(): ?string
  407.     {
  408.         return $this->egc;
  409.     }
  410.     public function setEgc(string $egc): self
  411.     {
  412.         $this->egc = $egc;
  413.         return $this;
  414.     }
  415.     public function getValeur(): ?string
  416.     {
  417.         return $this->valeur;
  418.     }
  419.     public function setValeur(string $valeur): self
  420.     {
  421.         $this->valeur = $valeur;
  422.         return $this;
  423.     }
  424.     public function getBudgetrev(): ?string
  425.     {
  426.         return $this->budgetrev;
  427.     }
  428.     public function setBudgetrev(string $budgetrev): self
  429.     {
  430.         $this->budgetrev = $budgetrev;
  431.         return $this;
  432.     }
  433.     public function getTyperev(): ?string
  434.     {
  435.         return $this->typerev;
  436.     }
  437.     public function setTyperev(string $typerev): self
  438.     {
  439.         $this->typerev = $typerev;
  440.         return $this;
  441.     }
  442.     /**
  443.      * @return Collection<int, ChantierProduct>
  444.      */
  445.     public function getChantierProducts(): Collection
  446.     {
  447.         return $this->chantierProducts;
  448.     }
  449.     public function addChantierProduct(ChantierProduct $chantierProduct): self
  450.     {
  451.         if (!$this->chantierProducts->contains($chantierProduct)) {
  452.             $this->chantierProducts->add($chantierProduct);
  453.             $chantierProduct->setChantier($this);
  454.         }
  455.         return $this;
  456.     }
  457.     public function removeChantierProduct(ChantierProduct $chantierProduct): self
  458.     {
  459.         if ($this->chantierProducts->removeElement($chantierProduct)) {
  460.             // set the owning side to null (unless already changed)
  461.             if ($chantierProduct->getChantier() === $this) {
  462.                 $chantierProduct->setChantier(null);
  463.             }
  464.         }
  465.         return $this;
  466.     }
  467.     public function getProducts(): ?string
  468.     {
  469.         return $this->products;
  470.     }
  471.     public function setProducts(string $products): self
  472.     {
  473.         $this->products = $products;
  474.         return $this;
  475.     }
  476.     public function getConcurrent(): ?string
  477.     {
  478.         return $this->concurrent;
  479.     }
  480.     public function setConcurrent(string $concurrent): self
  481.     {
  482.         $this->concurrent = $concurrent;
  483.         return $this;
  484.     }
  485.     public function getMcarre(): ?string
  486.     {
  487.         return $this->mcarre;
  488.     }
  489.     public function setMcarre(?string $mcarre): self
  490.     {
  491.         $this->mcarre = $mcarre;
  492.         return $this;
  493.     }
  494.     public function getVglobal(): ?string
  495.     {
  496.         return $this->vglobal;
  497.     }
  498.     public function setVglobal(?string $vglobal): self
  499.     {
  500.         $this->vglobal = $vglobal;
  501.         return $this;
  502.     }
  503.     public function getFinancement(): ?string
  504.     {
  505.         return $this->financement;
  506.     }
  507.     public function setFinancement(?string $financement): self
  508.     {
  509.         $this->financement = $financement;
  510.         return $this;
  511.     }
  512.     public function getDatedebut(): ?string
  513.     {
  514.         return $this->datedebut;
  515.     }
  516.     public function setDatedebut(?string $datedebut): self
  517.     {
  518.         $this->datedebut = $datedebut;
  519.         return $this;
  520.     }
  521.     public function getClient(): ?revendeur
  522.     {
  523.         return $this->client;
  524.     }
  525.     public function setClient(?revendeur $client): self
  526.     {
  527.         $this->client = $client;
  528.         return $this;
  529.     }
  530.     public function getOtherclient(): ?string
  531.     {
  532.         return $this->otherclient;
  533.     }
  534.     public function setOtherclient(?string $otherclient): self
  535.     {
  536.         $this->otherclient = $otherclient;
  537.         return $this;
  538.     }
  539.     public function getDepartement(): ?Departement
  540.     {
  541.         return $this->departement;
  542.     }
  543.     public function setDepartement(?Departement $departement): self
  544.     {
  545.         $this->departement = $departement;
  546.         return $this;
  547.     }
  548.     public function getChoix(): ?string
  549.     {
  550.         return $this->choix;
  551.     }
  552.     public function setChoix(string $choix): self
  553.     {
  554.         $this->choix = $choix;
  555.         return $this;
  556.     }
  557.     
  558. }