src/Entity/Contact.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Doctrine\ORM\Mapping\OneToMany;
  8. use Doctrine\ORM\Mapping\OneToOne;
  9. use App\Entity\PriceLevel;
  10. /**
  11.  * @ORM\Entity(repositoryClass="App\EntityRepo\ContactRepo")
  12.  * @ORM\Table(name="contact")
  13.  */
  14. class Contact
  15. {
  16.     /**
  17.      * @ORM\Column(type="integer")
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="AUTO")
  20.      */ 
  21.     private int $contactId=0;
  22.     
  23.     /**
  24.      * @ORM\Column(type="string", length=100, nullable=true)
  25.      */
  26.     protected $title='';
  27.     
  28.     /**
  29.      * @ORM\Column(type="string", name="first_name", length=255, nullable=true)
  30.      */
  31.     protected $firstName;    
  32.     
  33.     /**
  34.      * @ORM\Column(type="string", name="middle_name", length=255, nullable=true)
  35.      */
  36.     protected $middleName;    
  37.     
  38.     /**
  39.      * @ORM\Column(type="string", name="last_name", length=255, nullable=true)
  40.      */
  41.     protected $lastName;    
  42.     
  43.     /**
  44.      * @ORM\Column(type="string", name="nick_name", length=255, nullable=true)
  45.      */
  46.     protected $nickName;    
  47.     
  48.     /**
  49.      * @ORM\Column(type="string", name="company_name", length=255, nullable=true)
  50.      */
  51.     protected $companyName;    
  52.     
  53.     /**
  54.      * @ORM\Column(type="string", length=255, nullable=true)
  55.      */
  56.     protected $email;    
  57.     
  58.     /**
  59.      * @ORM\Column(type="string", length=255, nullable=true)
  60.      */
  61.     protected $email2;    
  62.     
  63.     /**
  64.      * @ORM\Column(type="string", length=255, nullable=true)
  65.      */
  66.     protected $email3;    
  67.     
  68.     /**
  69.      * @ORM\Column(type="string", length=255, nullable=true)
  70.      */
  71.     protected $phone;    
  72.     
  73.     /**
  74.      * @ORM\Column(type="string", length=255, nullable=true)
  75.      */
  76.     protected $phone2;    
  77.     
  78.     /**
  79.      * @ORM\Column(type="string", length=255, nullable=true)
  80.      */
  81.     protected $phone3;    
  82.     
  83.     /**
  84.      * @ORM\Column(type="text", nullable=true)
  85.      */
  86.     protected $address1;    
  87.     
  88.     /**
  89.      * @ORM\Column(type="text", nullable=true)
  90.      */
  91.     protected $address2;    
  92.     
  93.     /**
  94.      * @ORM\Column(type="string", length=255, nullable=true)
  95.      */
  96.     protected $zipCode;    
  97.     
  98.     /**
  99.      * @ORM\Column(type="string", length=255, nullable=true)
  100.      */
  101.     protected $country;   
  102.     
  103.     /**
  104.      * @ORM\Column(type="text", nullable=true)
  105.      */
  106.     protected $invoiceAddress1;
  107.     
  108.     /**
  109.      * @ORM\Column(type="text", nullable=true)
  110.      */
  111.     protected $invoiceAddress2;
  112.     
  113.     /**
  114.      * @ORM\Column(type="string", length=255, nullable=true)
  115.      */
  116.     protected $invoiceZipCode;
  117.     
  118.     /**
  119.      * @ORM\Column(type="string", length=255, nullable=true)
  120.      */
  121.     protected $invoiceCountry;    
  122.     
  123.     /**
  124.      * @ORM\Column(type="string", length=255, nullable=true)
  125.      */
  126.     protected $image1;
  127.     
  128.     /**
  129.      * @ORM\Column(type="string", length=255, nullable=true)
  130.      */
  131.     protected $image2;    
  132.     
  133.     /**
  134.      * @ORM\Column(type="string", length=255, nullable=true)
  135.      */
  136.     protected $contactUserName;
  137.     
  138.     /**
  139.      * @ORM\Column(type="string", length=255, nullable=true)
  140.      */
  141.     protected $contactUserPassword;    
  142.     /**
  143.      * @ORM\Column(type="string", length=255, nullable=true)
  144.      */
  145.     protected $businessId;    
  146.   
  147.     /**
  148.      * @ORM\Column(type="string", length=255, nullable=true)
  149.      */
  150.     protected $DICId;   
  151.     /**
  152.      * @ORM\Column(type="text", nullable=true)
  153.      */
  154.     protected $notes;
  155.     /*
  156.      * @ORM\OneToOne(targetEntity="Address", mappedBy="Contact", cascade={"persist"})
  157.      * @ORM\JoinColumn(name="address_id", referencedColumnName="address")
  158.      */
  159. //    #[OneToOne(targetEntity: Shipment::class)]
  160. //    #[JoinColumn(name: 'shipment_id', referencedColumnName: 'id')]
  161.     /*
  162.      * @ORM\OneToOne(targetEntity="Address")
  163.      * @ORM\JoinColumn(name="address_id", referencedColumnName="address_id")
  164.      */
  165.     /*
  166.      * @ORM\OneToOne(targetEntity="Address", cascade={"persist", "remove"})
  167.      * @ORM\JoinColumn(name="address_id", referencedColumnName="contact_id", nullable=true)
  168.      */
  169.     /*
  170.      * @ORM\OneToOne(targetEntity="Address", mappedBy="contact", cascade={"persist", "remove"})
  171.      */
  172.     /**
  173.      * @ORM\ManyToOne(targetEntity="Address", cascade={"persist"})
  174.      * @ORM\JoinColumn(name="address_id", referencedColumnName="address_id")
  175.      */
  176.     protected $address;
  177.     /*
  178.      * @ORM\OneToMany(targetEntity="Address", mappedBy="Contact", cascade={"persist"})
  179.      * @ORM\JoinColumn(name="delivery_address_id", referencedColumnName="address_id")
  180.      */
  181.     /*
  182.      * @ORM\OneToOne(targetEntity="Address")
  183.      * @ORM\JoinColumn(name="delivery_address_id", referencedColumnName="address_id")
  184.      */
  185.     /*
  186.      * @ORM\OneToOne(targetEntity="Address", mappedBy="contact", cascade={"persist", "remove"})
  187.      */
  188.     /**
  189.      * @ORM\ManyToOne(targetEntity="Address", cascade={"persist"})
  190.      * @ORM\JoinColumn(name="delivery_address_id", referencedColumnName="address_id")
  191.      */
  192.     protected $deliveryAddress;
  193.     /**
  194.      * Many Contacts have Many ContactGroups.
  195.      * @ORM\ManyToMany(targetEntity="ContactGroup")
  196.      * @ORM\JoinTable(name="contact_contact_group",
  197.      *      joinColumns={@ORM\JoinColumn(name="contact_id", referencedColumnName="contact_id")},
  198.      *      inverseJoinColumns={@ORM\JoinColumn(name="contact_group_id", referencedColumnName="contact_group_id", unique=false)}
  199.      *      )
  200.      */
  201.     protected $contactGroups;
  202.     /**
  203.       * Many Contacts have Many Consents.
  204.       * @ORM\ManyToMany(targetEntity="Consent")
  205.       * @ORM\JoinTable(name="contact_consent",
  206.       *      joinColumns={@ORM\JoinColumn(name="contact_id", referencedColumnName="contact_id")},
  207.       *      inverseJoinColumns={@ORM\JoinColumn(name="consent_id", referencedColumnName="consent_id", unique=false)}
  208.       *      )
  209.      */
  210.     protected Collection $consents;
  211.     /*
  212.      * @ORM\OneToOne(targetEntity="PriceLevel", mappedBy="contact")
  213.      * @ORM\JoinTable(name="price_level")
  214.      */
  215.     /*
  216.      * @ORM\OneToOne(targetEntity="PriceLevel", mappedBy="contact", cascade={"persist", "remove"})
  217.      */
  218.     /*
  219.      * One Contact has One PriceLevel.
  220.      * @OneToOne(targetEntity="PriceLevel")
  221.      * @JoinColumn(name="price_level_id", referencedColumnName="price_level_id")
  222.      */
  223.     /*
  224.      * Many Contacts have One PriceLevel.
  225.      * @ORM\ManyToOne(targetEntity="PriceLevel")
  226.      * @ORM\JoinColumn(name="price_level_id", referencedColumnName="price_level_id")
  227.      */
  228.     /**
  229.      * @ORM\ManyToOne(targetEntity="PriceLevel", cascade={"persist"})
  230.      * @ORM\JoinColumn(name="price_level_id", referencedColumnName="price_level_id")
  231.      */
  232.     protected $priceLevel;
  233.     /**
  234.      * @ORM\Column(type="string", length=100, nullable=true)
  235.      */    
  236.     protected $ERPKey;
  237.     public function __construct()
  238.     {
  239.         $this->contactGroups = new ArrayCollection();
  240.         $this->consents = new ArrayCollection();
  241.     }
  242.     public function getContactId(): ?int
  243.     {
  244.         return $this->contactId;
  245.     }
  246.     public function getTitle(): ?string
  247.     {
  248.         return $this->title;
  249.     }
  250.     public function setTitle(?string $title): static
  251.     {
  252.         $this->title $title;
  253.         return $this;
  254.     }
  255.     public function getFirstName(): ?string
  256.     {
  257.         return $this->firstName;
  258.     }
  259.     public function setFirstName(?string $firstName): static
  260.     {
  261.         $this->firstName $firstName;
  262.         return $this;
  263.     }
  264.     public function getMiddleName(): ?string
  265.     {
  266.         return $this->middleName;
  267.     }
  268.     public function setMiddleName(?string $middleName): static
  269.     {
  270.         $this->middleName $middleName;
  271.         return $this;
  272.     }
  273.     public function getLastName(): ?string
  274.     {
  275.         return $this->lastName;
  276.     }
  277.     public function setLastName(?string $lastName): static
  278.     {
  279.         $this->lastName $lastName;
  280.         return $this;
  281.     }
  282.     public function getNickName(): ?string
  283.     {
  284.         return $this->nickName;
  285.     }
  286.     public function setNickName(?string $nickName): static
  287.     {
  288.         $this->nickName $nickName;
  289.         return $this;
  290.     }
  291.     public function getCompanyName(): ?string
  292.     {
  293.         return $this->companyName;
  294.     }
  295.     public function setCompanyName(?string $companyName): static
  296.     {
  297.         $this->companyName $companyName;
  298.         return $this;
  299.     }
  300.     public function getEmail(): ?string
  301.     {
  302.         return $this->email;
  303.     }
  304.     public function setEmail(?string $email): static
  305.     {
  306.         $this->email $email;
  307.         return $this;
  308.     }
  309.     public function getEmail2(): ?string
  310.     {
  311.         return $this->email2;
  312.     }
  313.     public function setEmail2(?string $email2): static
  314.     {
  315.         $this->email2 $email2;
  316.         return $this;
  317.     }
  318.     public function getEmail3(): ?string
  319.     {
  320.         return $this->email3;
  321.     }
  322.     public function setEmail3(?string $email3): static
  323.     {
  324.         $this->email3 $email3;
  325.         return $this;
  326.     }
  327.     public function getPhone(): ?string
  328.     {
  329.         return $this->phone;
  330.     }
  331.     public function setPhone(?string $phone): static
  332.     {
  333.         $this->phone $phone;
  334.         return $this;
  335.     }
  336.     public function getPhone2(): ?string
  337.     {
  338.         return $this->phone2;
  339.     }
  340.     public function setPhone2(?string $phone2): static
  341.     {
  342.         $this->phone2 $phone2;
  343.         return $this;
  344.     }
  345.     public function getPhone3(): ?string
  346.     {
  347.         return $this->phone3;
  348.     }
  349.     public function setPhone3(?string $phone3): static
  350.     {
  351.         $this->phone3 $phone3;
  352.         return $this;
  353.     }
  354.     public function getAddress1(): ?string
  355.     {
  356.         return $this->address1;
  357.     }
  358.     public function setAddress1(?string $address1): static
  359.     {
  360.         $this->address1 $address1;
  361.         return $this;
  362.     }
  363.     public function getAddress2(): ?string
  364.     {
  365.         return $this->address2;
  366.     }
  367.     public function setAddress2(?string $address2): static
  368.     {
  369.         $this->address2 $address2;
  370.         return $this;
  371.     }
  372.     public function getZipCode(): ?string
  373.     {
  374.         return $this->zipCode;
  375.     }
  376.     public function setZipCode(?string $zipCode): static
  377.     {
  378.         $this->zipCode $zipCode;
  379.         return $this;
  380.     }
  381.     public function getCountry(): ?string
  382.     {
  383.         return $this->country;
  384.     }
  385.     public function setCountry(?string $country): static
  386.     {
  387.         $this->country $country;
  388.         return $this;
  389.     }
  390.     public function getInvoiceAddress1(): ?string
  391.     {
  392.         return $this->invoiceAddress1;
  393.     }
  394.     public function setInvoiceAddress1(?string $invoiceAddress1): static
  395.     {
  396.         $this->invoiceAddress1 $invoiceAddress1;
  397.         return $this;
  398.     }
  399.     public function getInvoiceAddress2(): ?string
  400.     {
  401.         return $this->invoiceAddress2;
  402.     }
  403.     public function setInvoiceAddress2(?string $invoiceAddress2): static
  404.     {
  405.         $this->invoiceAddress2 $invoiceAddress2;
  406.         return $this;
  407.     }
  408.     public function getInvoiceZipCode(): ?string
  409.     {
  410.         return $this->invoiceZipCode;
  411.     }
  412.     public function setInvoiceZipCode(?string $invoiceZipCode): static
  413.     {
  414.         $this->invoiceZipCode $invoiceZipCode;
  415.         return $this;
  416.     }
  417.     public function getInvoiceCountry(): ?string
  418.     {
  419.         return $this->invoiceCountry;
  420.     }
  421.     public function setInvoiceCountry(?string $invoiceCountry): static
  422.     {
  423.         $this->invoiceCountry $invoiceCountry;
  424.         return $this;
  425.     }
  426.     public function getImage1(): ?string
  427.     {
  428.         return $this->image1;
  429.     }
  430.     public function setImage1(?string $image1): static
  431.     {
  432.         $this->image1 $image1;
  433.         return $this;
  434.     }
  435.     public function getImage2(): ?string
  436.     {
  437.         return $this->image2;
  438.     }
  439.     public function setImage2(?string $image2): static
  440.     {
  441.         $this->image2 $image2;
  442.         return $this;
  443.     }
  444.     public function getContactUserName(): ?string
  445.     {
  446.         return $this->contactUserName;
  447.     }
  448.     public function setContactUserName(?string $contactUserName): static
  449.     {
  450.         $this->contactUserName $contactUserName;
  451.         return $this;
  452.     }
  453.     public function getContactUserPassword(): ?string
  454.     {
  455.         return $this->contactUserPassword;
  456.     }
  457.     public function setContactUserPassword(?string $contactUserPassword): static
  458.     {
  459.         $this->contactUserPassword $contactUserPassword;
  460.         return $this;
  461.     }
  462.     public function getBusinessId(): ?string
  463.     {
  464.         return $this->businessId;
  465.     }
  466.     public function setBusinessId(?string $businessId): static
  467.     {
  468.         $this->businessId $businessId;
  469.         return $this;
  470.     }
  471.     public function getDICId(): ?string
  472.     {
  473.         return $this->DICId;
  474.     }
  475.     public function setDICId(?string $DICId): static
  476.     {
  477.         $this->DICId $DICId;
  478.         return $this;
  479.     }
  480.     public function getNotes(): ?string
  481.     {
  482.         return $this->notes;
  483.     }
  484.     public function setNotes(?string $notes): static
  485.     {
  486.         $this->notes $notes;
  487.         return $this;
  488.     }
  489.     public function getERPKey(): ?string
  490.     {
  491.         return $this->ERPKey;
  492.     }
  493.     public function setERPKey(?string $ERPKey): static
  494.     {
  495.         $this->ERPKey $ERPKey;
  496.         return $this;
  497.     }
  498.     public function getAddress(): ?Address
  499.     {
  500.         return $this->address;
  501.     }
  502.     public function setAddress(?Address $address): static
  503.     {
  504.         $this->address $address;
  505.         return $this;
  506.     }
  507.     public function getDeliveryAddress(): ?Address
  508.     {
  509.         return $this->deliveryAddress;
  510.     }
  511.     public function setDeliveryAddress(?Address $deliveryAddress): static
  512.     {
  513.         $this->deliveryAddress $deliveryAddress;
  514.         return $this;
  515.     }
  516.     /**
  517.      * @return Collection<int, ContactGroup>
  518.      */
  519.     public function getContactGroups(): Collection
  520.     {
  521.         return $this->contactGroups;
  522.     }
  523.     public function addContactGroup(ContactGroup $contactGroup): static
  524.     {
  525.         if (!$this->contactGroups->contains($contactGroup)) {
  526.             $this->contactGroups->add($contactGroup);
  527.         }
  528.         return $this;
  529.     }
  530.     public function removeContactGroup(ContactGroup $contactGroup): static
  531.     {
  532.         $this->contactGroups->removeElement($contactGroup);
  533.         return $this;
  534.     }
  535.     /**
  536.      * @return Collection<int, Consent>
  537.      */
  538.     public function getConsents(): Collection
  539.     {
  540.         return $this->consents;
  541.     }
  542.     public function addConsent(Consent $consent): static
  543.     {
  544.         if (!$this->consents->contains($consent)) {
  545.             $this->consents->add($consent);
  546.         }
  547.         return $this;
  548.     }
  549.     public function removeConsent(Consent $consent): static
  550.     {
  551.         $this->consents->removeElement($consent);
  552.         return $this;
  553.     }
  554.     public function getPriceLevel(): ?PriceLevel
  555.     {
  556.         return $this->priceLevel;
  557.     }
  558.     public function setPriceLevel(?PriceLevel $priceLevel): static
  559.     {
  560.         $this->priceLevel $priceLevel;
  561.         return $this;
  562.     }
  563. }