src/Entity/Supplier.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SupplierRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use App\Form\EmailType;
  9. /**
  10.  * @ORM\Entity(repositoryClass=SupplierRepository::class)
  11.  */
  12. class Supplier {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=180, nullable=true)
  21.      */
  22.     private $name;
  23.     /**
  24.      * @ORM\Column(type="string", length=255, nullable=true)
  25.      */
  26.     private $civility;
  27.     /**
  28.      * @ORM\Column(type="string", length=255, nullable=true)
  29.      */
  30.     private $nameResponsable ;
  31.     /**
  32.      * @ORM\Column(type="string", length=180, nullable=true)
  33.      * @Assert\Email(
  34.      *     message = "L'adresse email '{{ value }}' n'est pas valide."
  35.      * )
  36.      */
  37.     private $email;
  38.     /**
  39.      * @ORM\Column(type="text", nullable=true)
  40.      */
  41.     private $description;
  42.     /**
  43.      * @ORM\Column(type="string", length=20, nullable=true)
  44.      */
  45.     private $phone;
  46.     /**
  47.      * @ORM\Column(type="string", length=30, nullable=true)
  48.      */
  49.     private $second_phone;
  50.     /**
  51.      * @ORM\Column(type="text", nullable=true)
  52.      */
  53.     private $adress;
  54.     /**
  55.      * @ORM\Column(type="text", nullable=true)
  56.      */
  57.     private $second_adress;
  58.     /**
  59.      * @ORM\Column(type="string", length=100, nullable=true)
  60.      */
  61.     private $country;
  62.     /**
  63.      * @ORM\Column(type="string", length=100, nullable=true)
  64.      */
  65.     private ?string $region null;
  66.     /**
  67.      * @ORM\Column(type="string", length=255, nullable=true)
  68.      */
  69.     private $city;
  70.     /**
  71.      * @ORM\Column(type="string", length=255, nullable=true)
  72.      */
  73.     private $tariff_category;
  74.     /**
  75.      * @ORM\Column(type="string", length=255, nullable=true)
  76.      */
  77.     private $zip;
  78.     /**
  79.      * @ORM\Column(type="datetime")
  80.      */
  81.     private $createdAt;
  82.     /**
  83.      * @ORM\OneToMany(targetEntity=Document::class, mappedBy="supplier")
  84.      */
  85.     private $documents;
  86.     /**
  87.      * @ORM\OneToMany(targetEntity=Address::class, mappedBy="supplier")
  88.      */
  89.     private $multiAddress;
  90.     /**
  91.      * @ORM\Column(type="string", length=255, nullable=true)
  92.      */
  93.     private $type;
  94.     /**
  95.      * @ORM\Column(type="boolean", options={"default": true})
  96.      */
  97.     private bool $isActive true;    
  98.     /**
  99.      * @ORM\Column(type="string", length=255, nullable=true)
  100.      */
  101.     private $raisonSociale;
  102.     /**
  103.      * @ORM\Column(type="string", length=100, nullable=true)
  104.      */
  105.     private $identifiantFiscal;
  106.     /**
  107.      * @ORM\Column(type="string", length=100, nullable=true)
  108.      */
  109.     private $iban;
  110.     /**
  111.      * @ORM\Column(type="string", length=100, nullable=true)
  112.      */
  113.     private $bankName;
  114.     /**
  115.      * @ORM\Column(type="string", length=255, nullable=true)
  116.      */
  117.     private $website;
  118.     /**
  119.      * @ORM\Column(type="string", length=20, nullable=true)
  120.      */
  121.     private $phoneResponsible1;
  122.     /**
  123.      * @ORM\Column(type="string", length=20, nullable=true)
  124.      */
  125.     private $phoneResponsible2;
  126.     /**
  127.      * @ORM\OneToMany(targetEntity=Contact::class, mappedBy="linkedSupplier")
  128.      */
  129.     private $contacts;
  130.     /**
  131.      * @ORM\OneToMany(targetEntity=Comment::class, mappedBy="supplier", cascade={"persist", "remove"})
  132.      */
  133.     private $comments;
  134.     /**
  135.      * @ORM\Column(type="string", length=255, nullable=true)
  136.      */
  137.     private ?string $logo null;
  138.     
  139.     public function __construct()
  140.     {
  141.         $this->documents = new ArrayCollection();
  142.         $this->multiAddress = new ArrayCollection();
  143.         $this->contacts = new ArrayCollection();
  144.         $this->comments = new ArrayCollection();
  145.     }
  146.     public function getId(): ?int {
  147.         return $this->id;
  148.     }
  149.     public function getName(): ?string {
  150.         return $this->name;
  151.     }
  152.     public function setName(string $name): self {
  153.         $this->name $name;
  154.         return $this;
  155.     }
  156.     public function getCivility(): ?string {
  157.         return $this->civility;
  158.     }
  159.     public function setCivility(string $civility): self {
  160.         $this->civility $civility;
  161.         return $this;
  162.     }
  163.     public function getNameResponsable(): ?string {
  164.         return $this->nameResponsable;
  165.     }
  166.     public function setNameResponsable (string $nameResponsable): self {
  167.         $this->nameResponsable $nameResponsable;
  168.         return $this;
  169.     }
  170.     public function getEmail(): ?string {
  171.         return $this->email;
  172.     }
  173.     public function setEmail(string $email): self {
  174.         $this->email $email;
  175.         return $this;
  176.     }
  177.     public function getDescription(): ?string {
  178.         return $this->description;
  179.     }
  180.     public function setDescription(string $description): self {
  181.         $this->description $description;
  182.         return $this;
  183.     }
  184.     public function getPhone(): ?string {
  185.         return $this->phone;
  186.     }
  187.     public function setPhone(string $phone): self {
  188.         $this->phone $phone;
  189.         return $this;
  190.     }
  191.     public function getSecondPhone(): ?string {
  192.         return $this->second_phone;
  193.     }
  194.     public function setSecondPhone(?string $second_phone): self {
  195.         $this->second_phone $second_phone;
  196.         return $this;
  197.     }
  198.     public function getAdress(): ?string {
  199.         return $this->adress;
  200.     }
  201.     public function setAdress(string $adress): self {
  202.         $this->adress $adress;
  203.         return $this;
  204.     }
  205.     public function getSecondAdress(): ?string {
  206.         return $this->second_adress;
  207.     }
  208.     public function setSecondAdress(?string $second_adress): self {
  209.         $this->second_adress $second_adress;
  210.         return $this;
  211.     }
  212.     public function getCountry(): ?string {
  213.         return $this->country;
  214.     }
  215.     public function setCountry(string $country): self {
  216.         $this->country $country;
  217.         return $this;
  218.     }
  219.     public function getRegion(): ?string {
  220.         return $this->region;
  221.     }
  222.     public function setRegion(?string $region): self
  223.     {
  224.         $this->region $region;
  225.         return $this;
  226.     }
  227.     public function getCity(): ?string {
  228.         return $this->city;
  229.     }
  230.     public function setCity(string $city): self {
  231.         $this->city $city;
  232.         return $this;
  233.     }
  234.     public function getTariffCategory(): ?string {
  235.         return $this->tariff_category;
  236.     }
  237.     public function setTariffCategory(?string $tariff_category): self {
  238.         $this->tariff_category $tariff_category;
  239.         return $this;
  240.     }
  241.     public function getZip(): ?string {
  242.         return $this->zip;
  243.     }
  244.     public function setZip(string $zip): self {
  245.         $this->zip $zip;
  246.         return $this;
  247.     }
  248.      public function getLogo(): ?string 
  249.     
  250.         return $this->logo
  251.     }
  252.     public function setLogo(?string $logo): self 
  253.     
  254.         $this->logo $logo; return $this
  255.     }
  256.     public function getCreatedAt(): ?\DateTimeInterface
  257.     {
  258.         return $this->createdAt;
  259.     }
  260.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  261.     {
  262.         $this->createdAt $createdAt;
  263.         return $this;
  264.     }
  265.     public function isActive(): bool
  266.     {
  267.         return $this->isActive;
  268.     }
  269.     public function setIsActive(bool $isActive): self
  270.     {
  271.         $this->isActive $isActive;
  272.         return $this;
  273.     }
  274.     /**
  275.      * @return Collection|Document[]
  276.      */
  277.     public function getDocuments(): Collection
  278.     {
  279.         return $this->documents;
  280.     }
  281.     public function addDocument(Document $document): self
  282.     {
  283.         if( !$this->documents->contains($document)) {
  284.             $this->documents[] = $document;
  285.             $document->setSupplier($this);
  286.         }
  287.         return $this;
  288.     }
  289.     public function removeDocument(Document $document): self
  290.     {
  291.         if( $this->documents->removeElement($document)) {
  292.             // set the owning side to null (unless already changed)
  293.             if( $document->getSupplier() === $this) {
  294.                 $document->setSupplier(null);
  295.             }
  296.         }
  297.         return $this;
  298.     }
  299.     /**
  300.      * @return Collection|Address[]
  301.      */
  302.     public function getMultiAddress(): Collection
  303.     {
  304.         return $this->multiAddress;
  305.     }
  306.     public function addMultiAddress(Address $multiAddress): self
  307.     {
  308.         if( !$this->multiAddress->contains($multiAddress)) {
  309.             $this->multiAddress[] = $multiAddress;
  310.             $multiAddress->setSupplier($this);
  311.         }
  312.         return $this;
  313.     }
  314.     public function removeMultiAddress(Address $multiAddress): self
  315.     {
  316.         if( $this->multiAddress->removeElement($multiAddress)) {
  317.             // set the owning side to null (unless already changed)
  318.             if( $multiAddress->getSupplier() === $this) {
  319.                 $multiAddress->setSupplier(null);
  320.             }
  321.         }
  322.         return $this;
  323.     }
  324.     public function getType(): ?string
  325.     {
  326.         return $this->type;
  327.     }
  328.     public function setType(?string $type): self
  329.     {
  330.         $this->type $type;
  331.         return $this;
  332.     }
  333.     /**
  334.      * @return Collection|Contact[]
  335.      */
  336.     public function getContacts(): Collection
  337.     {
  338.         return $this->contacts;
  339.     }
  340.     public function addContact(Contact $contact): self
  341.     {
  342.         if( !$this->contacts->contains($contact)) {
  343.             $this->contacts[] = $contact;
  344.             $contact->setLinkedSupplier($this);
  345.         }
  346.         return $this;
  347.     }
  348.     public function removeContact(Contact $contact): self
  349.     {
  350.         if( $this->contacts->removeElement($contact)) {
  351.             // set the owning side to null (unless already changed)
  352.             if( $contact->getLinkedSupplier() === $this) {
  353.                 $contact->setLinkedSupplier(null);
  354.             }
  355.         }
  356.         return $this;
  357.     }
  358.     public function getRaisonSociale(): ?string
  359.     {
  360.         return $this->raisonSociale;
  361.     }
  362.     public function setRaisonSociale(?string $raisonSociale): self
  363.     {
  364.         $this->raisonSociale $raisonSociale;
  365.         return $this;
  366.     }
  367.     public function getIdentifiantFiscal(): ?string
  368.     {
  369.         return $this->identifiantFiscal;
  370.     }
  371.     public function setIdentifiantFiscal(?string $identifiantFiscal): self
  372.     {
  373.         $this->identifiantFiscal $identifiantFiscal;
  374.         return $this;
  375.     }
  376.     public function getIban(): ?string
  377.     {
  378.         return $this->iban;
  379.     }
  380.     public function setIban(?string $iban): self
  381.     {
  382.         $this->iban $iban;
  383.         return $this;
  384.     }
  385.     public function getBankName(): ?string
  386.     {
  387.         return $this->bankName;
  388.     }
  389.     public function setBankName(?string $bankName): self
  390.     {
  391.         $this->bankName $bankName;
  392.         return $this;
  393.     }
  394.     public function getWebsite(): ?string
  395.     {
  396.         return $this->website;
  397.     }
  398.     public function setWebsite(?string $website): self
  399.     {
  400.         $this->website $website;
  401.         return $this;
  402.     }
  403.     public function getPhoneResponsible1(): ?string
  404.     {
  405.         return $this->phoneResponsible1;
  406.     }
  407.     public function setPhoneResponsible1(?string $phoneResponsible1): self
  408.     {
  409.         $this->phoneResponsible1 $phoneResponsible1;
  410.         return $this;
  411.     }
  412.     public function getPhoneResponsible2(): ?string
  413.     {
  414.         return $this->phoneResponsible2;
  415.     }
  416.     public function setPhoneResponsible2(?string $phoneResponsible2): self
  417.     {
  418.         $this->phoneResponsible2 $phoneResponsible2;
  419.         return $this;
  420.     }
  421.     /**
  422.      * @return Collection|Comment[]
  423.      */
  424.     public function getComments(): Collection
  425.     {
  426.         return $this->comments;
  427.     }
  428.     public function addComment(Comment $comment): self
  429.     {
  430.         if( !$this->comments->contains($comment)) {
  431.             $this->comments[] = $comment;
  432.             $comment->setSupplier($this);
  433.         }
  434.         return $this;
  435.     }
  436.     public function removeComment(Comment $comment): self
  437.     {
  438.         if( $this->comments->removeElement($comment)) {
  439.             // set the owning side to null (unless already changed)
  440.             if( $comment->getSupplier() === $this) {
  441.                 $comment->setSupplier(null);
  442.             }
  443.         }
  444.         return $this;
  445.     }
  446.    
  447.     
  448. }