src/Entity/CustomerDetail.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use  Symfony\Component\Validator\Constraints as Assert;
  5. /**
  6.  * @ORM\Entity(repositoryClass="App\Repository\CustomerDetailRepository")
  7.  */
  8. class CustomerDetail
  9. {
  10.     /**
  11.      * @ORM\Id()
  12.      * @ORM\GeneratedValue()
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="string", length=50, nullable=true)
  18.      */
  19.     private $customerNumber;
  20.     /**
  21.      * @ORM\Column(type="string", length=255, nullable=true)
  22.      */
  23.     private $country;
  24.     /**
  25.      * @ORM\Column(type="string", length=20, nullable=true)
  26.      */
  27.     private $city;
  28.     /**
  29.      * @ORM\Column(type="string", length=50, nullable=true)
  30.      */
  31.     private $companyName;
  32.     /**
  33.      * @ORM\Column(type="string", length=30, nullable=true)
  34.      */
  35.     private $state;
  36.     /**
  37.      * @ORM\Column(type="string", length=100, nullable=true)
  38.      */
  39.     private $businessType;
  40.     /**
  41.      * @ORM\Column(type="string", length=50, nullable=true)
  42.      * @Assert\Email(
  43.      *     message = "Please enter valid email."
  44.      * )
  45.      */
  46.     private $centralEmailAddress;
  47.     /**
  48.      * @ORM\Column(type="string", length=100, nullable=true)
  49.      */
  50.     private $street;
  51.     /**
  52.      * @ORM\Column(type="string", length=30, nullable=true)
  53.      * @Assert\Type(type="digit",message="Phone number has to be numeric")
  54.      * @Assert\Regex(
  55.      *     pattern="/^[0-9]+$/",
  56.      *     message="Phone number has to be numeric"
  57.      * )
  58.      */
  59.     private $centralPhoneNumber;
  60.     /**
  61.      * @ORM\Column(type="string", length=15, nullable=true)
  62.      */
  63.     private $zipCode;
  64.     /**
  65.      * @ORM\Column(type="string", length=30, nullable=true)
  66.      */
  67.     private $vatNumber;
  68.     /**
  69.      * @ORM\OneToOne(targetEntity="App\Entity\User", inversedBy="customerDetail", cascade={"persist"})
  70.      */
  71.     private $customer;
  72.     public function __toString()
  73.     {
  74.         return $this->getCompanyName();
  75.     }
  76.     public function getId(): ?int
  77.     {
  78.         return $this->id;
  79.     }
  80.     public function getCustomerNumber(): ?string
  81.     {
  82.         return $this->customerNumber;
  83.     }
  84.     public function setCustomerNumber(?string $customerNumber): self
  85.     {
  86.         $this->customerNumber $customerNumber;
  87.         return $this;
  88.     }
  89.     public function getCity(): ?string
  90.     {
  91.         return $this->city;
  92.     }
  93.     public function setCity(?string $city): self
  94.     {
  95.         $this->city $city;
  96.         return $this;
  97.     }
  98.     public function getCompanyName(): ?string
  99.     {
  100.         return $this->companyName;
  101.     }
  102.     public function setCompanyName(?string $companyName): self
  103.     {
  104.         $this->companyName $companyName;
  105.         return $this;
  106.     }
  107.     public function getState(): ?string
  108.     {
  109.         return $this->state;
  110.     }
  111.     public function setState(?string $state): self
  112.     {
  113.         $this->state $state;
  114.         return $this;
  115.     }
  116.     public function getBusinessType(): ?string
  117.     {
  118.         return $this->businessType;
  119.     }
  120.     public function setBusinessType(?string $businessType): self
  121.     {
  122.         $this->businessType $businessType;
  123.         return $this;
  124.     }
  125.     public function getCentralEmailAddress(): ?string
  126.     {
  127.         return $this->centralEmailAddress;
  128.     }
  129.     public function setCentralEmailAddress(?string $centralEmailAddress): self
  130.     {
  131.         $this->centralEmailAddress $centralEmailAddress;
  132.         return $this;
  133.     }
  134.     public function getStreet(): ?string
  135.     {
  136.         return $this->street;
  137.     }
  138.     public function setStreet(?string $street): self
  139.     {
  140.         $this->street $street;
  141.         return $this;
  142.     }
  143.     public function getCentralPhoneNumber(): ?string
  144.     {
  145.         return $this->centralPhoneNumber;
  146.     }
  147.     public function setCentralPhoneNumber(?string $centralPhoneNumber): self
  148.     {
  149.         $this->centralPhoneNumber $centralPhoneNumber;
  150.         return $this;
  151.     }
  152.     public function getZipCode(): ?string
  153.     {
  154.         return $this->zipCode;
  155.     }
  156.     public function setZipCode(?string $zipCode): self
  157.     {
  158.         $this->zipCode $zipCode;
  159.         return $this;
  160.     }
  161.     public function getVatNumber(): ?string
  162.     {
  163.         return $this->vatNumber;
  164.     }
  165.     public function setVatNumber(?string $vatNumber): self
  166.     {
  167.         $this->vatNumber $vatNumber;
  168.         return $this;
  169.     }
  170.     public function getCustomer(): ?User
  171.     {
  172.         return $this->customer;
  173.     }
  174.     public function setCustomer(?User $customer): self
  175.     {
  176.         $this->customer $customer;
  177.         return $this;
  178.     }
  179.     public function getCountry(): ?string
  180.     {
  181.         return $this->country;
  182.     }
  183.     public function setCountry(?string $country): self
  184.     {
  185.         $this->country $country;
  186.         return $this;
  187.     }
  188. }