src/Entity/Entreprise.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EntrepriseRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10.  * @ORM\Entity(repositoryClass=EntrepriseRepository::class)
  11.  * @UniqueEntity(
  12.  *      fields={"email"},
  13.  *      message="Ce mail est déjà utilisé."
  14.  * )
  15.  * @UniqueEntity(fields={"telephone"},message="Ce téléphone est déjà utilisé." )
  16.  * @UniqueEntity(fields={"wording"},message="Cette raison sociale est déjà utilisée." )
  17.  */
  18. class Entreprise
  19. {
  20.     /**
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue
  23.      * @ORM\Column(type="integer")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @ORM\Column(type="text")
  28.      */
  29.     private $wording;
  30.     /**
  31.      * @ORM\Column(type="text", nullable=true)
  32.      */
  33.     private $siret;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=Inscrit::class, mappedBy="entreprise")
  36.      */
  37.     private $inscrits;
  38.     /**
  39.      * @ORM\Column(type="text", nullable=true)
  40.      */
  41.     private $address;
  42.     /**
  43.      * @ORM\Column(type="string", length=255,nullable=true)
  44.      * @Assert\Email(message = "L'email '{{ value }}' n'est pas valide.")
  45.      */
  46.     private $email;
  47.     /**
  48.      * @ORM\Column(type="string", length=255, nullable=true)
  49.      * @Assert\Length(min=8,minMessage = "La taille minimum doit être de {{ limit }} caractères")
  50.      */
  51.     private $telephone;
  52.     /**
  53.      * @ORM\Column(type="string", length=255, nullable=true)
  54.      */
  55.     private $contact;
  56.     /**
  57.      * @ORM\Column(type="string", length=20, nullable=true)
  58.      * @Assert\Length(min=8,minMessage = "La taille minimum doit être de {{ limit }} caractères")
  59.      */
  60.     private $contacttelephone;
  61.     /**
  62.      * @ORM\OneToMany(targetEntity=Financement::class, mappedBy="entreprise")
  63.      */
  64.     private $financements;
  65.     /**
  66.      * @ORM\OneToMany(targetEntity=ReglementEntreprise::class, mappedBy="entreprise")
  67.      */
  68.     private $reglementEntreprises;
  69.     /**
  70.      * @ORM\OneToMany(targetEntity=EnteteConvention::class, mappedBy="entreprise")
  71.      */
  72.     private $enteteConventions;
  73.     /**
  74.      * @ORM\Column(type="string", length=255, nullable=true)
  75.      */
  76.     private $representant;
  77.     /**
  78.      * @ORM\OneToMany(targetEntity=DemandeLite::class, mappedBy="entreprise")
  79.      */
  80.     private $demandeLites;
  81.     /**
  82.      * @ORM\OneToMany(targetEntity=EnteteFacture::class, mappedBy="entreprise")
  83.      */
  84.     private $enteteFactures;
  85.     /**
  86.      * @ORM\OneToMany(targetEntity=DemandePro::class, mappedBy="entreprise")
  87.      */
  88.     private $demandePros;
  89.     
  90.     public function __construct()
  91.     {
  92.         $this->inscrits = new ArrayCollection();
  93.         $this->financements = new ArrayCollection();
  94.         $this->reglementEntreprises = new ArrayCollection();
  95.         $this->enteteConventions = new ArrayCollection();
  96.         $this->demandeLites = new ArrayCollection();
  97.         $this->enteteFactures = new ArrayCollection();
  98.         $this->demandePros = new ArrayCollection();
  99.     }
  100.     public function getId(): ?int
  101.     {
  102.         return $this->id;
  103.     }
  104.     public function getWording(): ?string
  105.     {
  106.         return $this->wording;
  107.     }
  108.     public function setWording(string $wording): self
  109.     {
  110.         $this->wording $wording;
  111.         return $this;
  112.     }
  113.     public function getSiret(): ?string
  114.     {
  115.         return $this->siret;
  116.     }
  117.     public function setSiret(?string $siret): self
  118.     {
  119.         $this->siret $siret;
  120.         return $this;
  121.     }
  122.     /**
  123.      * @return Collection<int, Inscrit>
  124.      */
  125.     public function getInscrits(): Collection
  126.     {
  127.         return $this->inscrits;
  128.     }
  129.     public function addInscrit(Inscrit $inscrit): self
  130.     {
  131.         if (!$this->inscrits->contains($inscrit)) {
  132.             $this->inscrits[] = $inscrit;
  133.             $inscrit->setEntreprise($this);
  134.         }
  135.         return $this;
  136.     }
  137.     public function removeInscrit(Inscrit $inscrit): self
  138.     {
  139.         if ($this->inscrits->removeElement($inscrit)) {
  140.             // set the owning side to null (unless already changed)
  141.             if ($inscrit->getEntreprise() === $this) {
  142.                 $inscrit->setEntreprise(null);
  143.             }
  144.         }
  145.         return $this;
  146.     }
  147.     public function getAddress(): ?string
  148.     {
  149.         return $this->address;
  150.     }
  151.     public function setAddress(?string $address): self
  152.     {
  153.         $this->address $address;
  154.         return $this;
  155.     }
  156.     public function getEmail(): ?string
  157.     {
  158.         return $this->email;
  159.     }
  160.     public function setEmail(?string $email): self
  161.     {
  162.         $this->email $email;
  163.         return $this;
  164.     }
  165.     public function getTelephone(): ?string
  166.     {
  167.         return $this->telephone;
  168.     }
  169.     public function setTelephone(?string $telephone): self
  170.     {
  171.         $this->telephone $telephone;
  172.         return $this;
  173.     }
  174.     public function getContact(): ?string
  175.     {
  176.         return $this->contact;
  177.     }
  178.     public function setContact(?string $contact): self
  179.     {
  180.         $this->contact $contact;
  181.         return $this;
  182.     }
  183.     public function getContacttelephone(): ?string
  184.     {
  185.         return $this->contacttelephone;
  186.     }
  187.     public function setContacttelephone(?string $contacttelephone): self
  188.     {
  189.         $this->contacttelephone $contacttelephone;
  190.         return $this;
  191.     }
  192.     /**
  193.      * @return Collection<int, Financement>
  194.      */
  195.     public function getFinancements(): Collection
  196.     {
  197.         return $this->financements;
  198.     }
  199.     public function addFinancement(Financement $financement): self
  200.     {
  201.         if (!$this->financements->contains($financement)) {
  202.             $this->financements[] = $financement;
  203.             $financement->setEntreprise($this);
  204.         }
  205.         return $this;
  206.     }
  207.     public function removeFinancement(Financement $financement): self
  208.     {
  209.         if ($this->financements->removeElement($financement)) {
  210.             // set the owning side to null (unless already changed)
  211.             if ($financement->getEntreprise() === $this) {
  212.                 $financement->setEntreprise(null);
  213.             }
  214.         }
  215.         return $this;
  216.     }
  217.     /**
  218.      * @return Collection<int, ReglementEntreprise>
  219.      */
  220.     public function getReglementEntreprises(): Collection
  221.     {
  222.         return $this->reglementEntreprises;
  223.     }
  224.     public function addReglementEntreprise(ReglementEntreprise $reglementEntreprise): self
  225.     {
  226.         if (!$this->reglementEntreprises->contains($reglementEntreprise)) {
  227.             $this->reglementEntreprises[] = $reglementEntreprise;
  228.             $reglementEntreprise->setEntreprise($this);
  229.         }
  230.         return $this;
  231.     }
  232.     public function removeReglementEntreprise(ReglementEntreprise $reglementEntreprise): self
  233.     {
  234.         if ($this->reglementEntreprises->removeElement($reglementEntreprise)) {
  235.             // set the owning side to null (unless already changed)
  236.             if ($reglementEntreprise->getEntreprise() === $this) {
  237.                 $reglementEntreprise->setEntreprise(null);
  238.             }
  239.         }
  240.         return $this;
  241.     }
  242.     /**
  243.      * @return Collection<int, EnteteConvention>
  244.      */
  245.     public function getEnteteConventions(): Collection
  246.     {
  247.         return $this->enteteConventions;
  248.     }
  249.     public function addEnteteConvention(EnteteConvention $enteteConvention): self
  250.     {
  251.         if (!$this->enteteConventions->contains($enteteConvention)) {
  252.             $this->enteteConventions[] = $enteteConvention;
  253.             $enteteConvention->setEntreprise($this);
  254.         }
  255.         return $this;
  256.     }
  257.     public function removeEnteteConvention(EnteteConvention $enteteConvention): self
  258.     {
  259.         if ($this->enteteConventions->removeElement($enteteConvention)) {
  260.             // set the owning side to null (unless already changed)
  261.             if ($enteteConvention->getEntreprise() === $this) {
  262.                 $enteteConvention->setEntreprise(null);
  263.             }
  264.         }
  265.         return $this;
  266.     }
  267.     public function getRepresentant(): ?string
  268.     {
  269.         return $this->representant;
  270.     }
  271.     public function setRepresentant(?string $representant): self
  272.     {
  273.         $this->representant $representant;
  274.         return $this;
  275.     }
  276.     /**
  277.      * @return Collection<int, DemandeLite>
  278.      */
  279.     public function getDemandeLites(): Collection
  280.     {
  281.         return $this->demandeLites;
  282.     }
  283.     public function addDemandeLite(DemandeLite $demandeLite): self
  284.     {
  285.         if (!$this->demandeLites->contains($demandeLite)) {
  286.             $this->demandeLites[] = $demandeLite;
  287.             $demandeLite->setEntreprise($this);
  288.         }
  289.         return $this;
  290.     }
  291.     public function removeDemandeLite(DemandeLite $demandeLite): self
  292.     {
  293.         if ($this->demandeLites->removeElement($demandeLite)) {
  294.             // set the owning side to null (unless already changed)
  295.             if ($demandeLite->getEntreprise() === $this) {
  296.                 $demandeLite->setEntreprise(null);
  297.             }
  298.         }
  299.         return $this;
  300.     }
  301.     /**
  302.      * @return Collection<int, EnteteFacture>
  303.      */
  304.     public function getEnteteFactures(): Collection
  305.     {
  306.         return $this->enteteFactures;
  307.     }
  308.     public function addEnteteFacture(EnteteFacture $enteteFacture): self
  309.     {
  310.         if (!$this->enteteFactures->contains($enteteFacture)) {
  311.             $this->enteteFactures[] = $enteteFacture;
  312.             $enteteFacture->setEntreprise($this);
  313.         }
  314.         return $this;
  315.     }
  316.     public function removeEnteteFacture(EnteteFacture $enteteFacture): self
  317.     {
  318.         if ($this->enteteFactures->removeElement($enteteFacture)) {
  319.             // set the owning side to null (unless already changed)
  320.             if ($enteteFacture->getEntreprise() === $this) {
  321.                 $enteteFacture->setEntreprise(null);
  322.             }
  323.         }
  324.         return $this;
  325.     }
  326.     /**
  327.      * @return Collection<int, DemandePro>
  328.      */
  329.     public function getDemandePros(): Collection
  330.     {
  331.         return $this->demandePros;
  332.     }
  333.     public function addDemandePro(DemandePro $demandePro): self
  334.     {
  335.         if (!$this->demandePros->contains($demandePro)) {
  336.             $this->demandePros[] = $demandePro;
  337.             $demandePro->setEntreprise($this);
  338.         }
  339.         return $this;
  340.     }
  341.     public function removeDemandePro(DemandePro $demandePro): self
  342.     {
  343.         if ($this->demandePros->removeElement($demandePro)) {
  344.             // set the owning side to null (unless already changed)
  345.             if ($demandePro->getEntreprise() === $this) {
  346.                 $demandePro->setEntreprise(null);
  347.             }
  348.         }
  349.         return $this;
  350.     }
  351. }