src/Daikin/BaseBundle/Entity/EmergencyStock/DeliveryAddress.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Daikin\BaseBundle\Entity\EmergencyStock;
  3. use App\Daikin\BaseBundle\Entity\AddressTrait;
  4. use App\Daikin\BaseBundle\Entity\GeoCoordinateInterface;
  5. use App\Daikin\BaseBundle\Entity\GeoCoordinateTrait;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * Class SparePartsDeliveryAddress
  9.  * @package App\Daikin\BaseBundle\Entity
  10.  *
  11.  * @ORM\Entity()
  12.  * @ORM\Table(name="DeliveryAddress")
  13.  */
  14. class DeliveryAddress implements GeoCoordinateInterface
  15. {
  16.     use AddressTraitGeoCoordinateTrait;
  17.     /**
  18.      * @var integer
  19.      *
  20.      * @ORM\Id()
  21.      * @ORM\Column(type="integer")
  22.      * @ORM\GeneratedValue(strategy="AUTO")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @var string
  27.      *
  28.      * @ORM\Column(type="string")
  29.      */
  30.     private $name;
  31.     /**
  32.      * @var string
  33.      *
  34.      * @ORM\Column(type="string", nullable=true)
  35.      */
  36.     private $company;
  37.     /**
  38.      * @var string
  39.      *
  40.      * @ORM\Column(type="string")
  41.      */
  42.     private $mobile;
  43.     /**
  44.      * @var string
  45.      *
  46.      * @ORM\Column(type="string", nullable=true)
  47.      */
  48.     private $phone;
  49.     /**
  50.      * @var string
  51.      *
  52.      * @ORM\Column(type="string")
  53.      */
  54.     private $email;
  55.     /**
  56.      * @var string
  57.      *
  58.      * @ORM\Column(name="customerName", type="string", nullable=true)
  59.      */
  60.     private $customerName;
  61.     /**
  62.      * @var string
  63.      *
  64.      * @ORM\Column(name="customerCompany", type="string", nullable=true)
  65.      */
  66.     private $customerCompany;
  67.     /**
  68.      * @var string
  69.      *
  70.      * @ORM\Column(name="customerEmail", type="string", nullable=true)
  71.      */
  72.     private $customerEmail;
  73.     /**
  74.      * @var string
  75.      *
  76.      * @ORM\Column(name="customerSAP", type="string", nullable=true)
  77.      */
  78.     private $customerSAP;
  79.     /**
  80.      * @var string
  81.      *
  82.      * @ORM\Column(name="customerAnnotation", type="text", nullable=true)
  83.      */
  84.     private $customerAnnotation;
  85.     /**
  86.      * @var string
  87.      *
  88.      * @ORM\Column(name="customerCommission", type="string", nullable=true)
  89.      */
  90.     private $customerCommission;
  91.     /**
  92.      * @return int
  93.      */
  94.     public function getId()
  95.     {
  96.         return $this->id;
  97.     }
  98.     /**
  99.      * @param int $id
  100.      */
  101.     public function setId($id)
  102.     {
  103.         $this->id $id;
  104.     }
  105.     /**
  106.      * @return string
  107.      */
  108.     public function getName()
  109.     {
  110.         return $this->name;
  111.     }
  112.     /**
  113.      * @param string $name
  114.      */
  115.     public function setName($name)
  116.     {
  117.         $this->name $name;
  118.     }
  119.     /**
  120.      * @return string
  121.      */
  122.     public function getCompany()
  123.     {
  124.         return $this->company;
  125.     }
  126.     /**
  127.      * @param string $company
  128.      */
  129.     public function setCompany($company)
  130.     {
  131.         $this->company $company;
  132.     }
  133.     /**
  134.      * @return string
  135.      */
  136.     public function getMobile()
  137.     {
  138.         return $this->mobile;
  139.     }
  140.     /**
  141.      * @param string $mobile
  142.      */
  143.     public function setMobile($mobile)
  144.     {
  145.         $this->mobile $mobile;
  146.     }
  147.     /**
  148.      * @return string
  149.      */
  150.     public function getPhone()
  151.     {
  152.         return $this->phone;
  153.     }
  154.     /**
  155.      * @param string $phone
  156.      */
  157.     public function setPhone($phone)
  158.     {
  159.         $this->phone $phone;
  160.     }
  161.     /**
  162.      * @return string
  163.      */
  164.     public function getEmail()
  165.     {
  166.         return $this->email;
  167.     }
  168.     /**
  169.      * @param string $email
  170.      */
  171.     public function setEmail($email)
  172.     {
  173.         $this->email $email;
  174.     }
  175.     /**
  176.      * @return string
  177.      */
  178.     public function getCustomerName()
  179.     {
  180.         return $this->customerName;
  181.     }
  182.     /**
  183.      * @param string $customerName
  184.      * @return DeliveryAddress
  185.      */
  186.     public function setCustomerName($customerName)
  187.     {
  188.         $this->customerName $customerName;
  189.         return $this;
  190.     }
  191.     /**
  192.      * @return string
  193.      */
  194.     public function getCustomerCompany()
  195.     {
  196.         return $this->customerCompany;
  197.     }
  198.     /**
  199.      * @param string $customerCompany
  200.      * @return DeliveryAddress
  201.      */
  202.     public function setCustomerCompany($customerCompany)
  203.     {
  204.         $this->customerCompany $customerCompany;
  205.         return $this;
  206.     }
  207.     /**
  208.      * @return string
  209.      */
  210.     public function getCustomerSAP()
  211.     {
  212.         return $this->customerSAP;
  213.     }
  214.     /**
  215.      * @param string $customerSAP
  216.      * @return DeliveryAddress
  217.      */
  218.     public function setCustomerSAP($customerSAP)
  219.     {
  220.         $this->customerSAP $customerSAP;
  221.         return $this;
  222.     }
  223.     /**
  224.      * @return string
  225.      */
  226.     public function getCustomerAnnotation()
  227.     {
  228.         return $this->customerAnnotation;
  229.     }
  230.     /**
  231.      * @param string $customerAnnotation
  232.      * @return DeliveryAddress
  233.      */
  234.     public function setCustomerAnnotation($customerAnnotation)
  235.     {
  236.         $this->customerAnnotation $customerAnnotation;
  237.         return $this;
  238.     }
  239.     /**
  240.      * @return string
  241.      */
  242.     public function getCustomerCommission()
  243.     {
  244.         return $this->customerCommission;
  245.     }
  246.     /**
  247.      * @param string $customerCommission
  248.      * @return DeliveryAddress
  249.      */
  250.     public function setCustomerCommission($customerCommission)
  251.     {
  252.         $this->customerCommission $customerCommission;
  253.         return $this;
  254.     }
  255.     /**
  256.      * @return string
  257.      */
  258.     public function getCustomerEmail()
  259.     {
  260.         return $this->customerEmail;
  261.     }
  262.     /**
  263.      * @param string $customerEmail
  264.      * @return DeliveryAddress
  265.      */
  266.     public function setCustomerEmail($customerEmail)
  267.     {
  268.         $this->customerEmail $customerEmail;
  269.         return $this;
  270.     }
  271.     public function hasAllSearchStringParts(): bool
  272.     {
  273.         return !empty($this->getStreet()) &&
  274.             !empty($this->getStreetNo()) &&
  275.             !empty($this->getZip()) &&
  276.             !empty($this->getCity());
  277.     }
  278.     public function getSearchString()
  279.     {
  280.         $string $this->getStreet(). ' '.
  281.             $this->getStreetNo().' '.
  282.             $this->getZip().' '.
  283.             $this->getCity().', ';
  284.         return str_replace(' ''+'$string);
  285.     }
  286. }