<?php
namespace App\Daikin\BaseBundle\Entity\EmergencyStock;
use App\Daikin\BaseBundle\Entity\AddressTrait;
use App\Daikin\BaseBundle\Entity\GeoCoordinateInterface;
use App\Daikin\BaseBundle\Entity\GeoCoordinateTrait;
use Doctrine\ORM\Mapping as ORM;
/**
* Class SparePartsDeliveryAddress
* @package App\Daikin\BaseBundle\Entity
*
* @ORM\Entity()
* @ORM\Table(name="DeliveryAddress")
*/
class DeliveryAddress implements GeoCoordinateInterface
{
use AddressTrait, GeoCoordinateTrait;
/**
* @var integer
*
* @ORM\Id()
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(type="string")
*/
private $name;
/**
* @var string
*
* @ORM\Column(type="string", nullable=true)
*/
private $company;
/**
* @var string
*
* @ORM\Column(type="string")
*/
private $mobile;
/**
* @var string
*
* @ORM\Column(type="string", nullable=true)
*/
private $phone;
/**
* @var string
*
* @ORM\Column(type="string")
*/
private $email;
/**
* @var string
*
* @ORM\Column(name="customerName", type="string", nullable=true)
*/
private $customerName;
/**
* @var string
*
* @ORM\Column(name="customerCompany", type="string", nullable=true)
*/
private $customerCompany;
/**
* @var string
*
* @ORM\Column(name="customerEmail", type="string", nullable=true)
*/
private $customerEmail;
/**
* @var string
*
* @ORM\Column(name="customerSAP", type="string", nullable=true)
*/
private $customerSAP;
/**
* @var string
*
* @ORM\Column(name="customerAnnotation", type="text", nullable=true)
*/
private $customerAnnotation;
/**
* @var string
*
* @ORM\Column(name="customerCommission", type="string", nullable=true)
*/
private $customerCommission;
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @param int $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getCompany()
{
return $this->company;
}
/**
* @param string $company
*/
public function setCompany($company)
{
$this->company = $company;
}
/**
* @return string
*/
public function getMobile()
{
return $this->mobile;
}
/**
* @param string $mobile
*/
public function setMobile($mobile)
{
$this->mobile = $mobile;
}
/**
* @return string
*/
public function getPhone()
{
return $this->phone;
}
/**
* @param string $phone
*/
public function setPhone($phone)
{
$this->phone = $phone;
}
/**
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* @param string $email
*/
public function setEmail($email)
{
$this->email = $email;
}
/**
* @return string
*/
public function getCustomerName()
{
return $this->customerName;
}
/**
* @param string $customerName
* @return DeliveryAddress
*/
public function setCustomerName($customerName)
{
$this->customerName = $customerName;
return $this;
}
/**
* @return string
*/
public function getCustomerCompany()
{
return $this->customerCompany;
}
/**
* @param string $customerCompany
* @return DeliveryAddress
*/
public function setCustomerCompany($customerCompany)
{
$this->customerCompany = $customerCompany;
return $this;
}
/**
* @return string
*/
public function getCustomerSAP()
{
return $this->customerSAP;
}
/**
* @param string $customerSAP
* @return DeliveryAddress
*/
public function setCustomerSAP($customerSAP)
{
$this->customerSAP = $customerSAP;
return $this;
}
/**
* @return string
*/
public function getCustomerAnnotation()
{
return $this->customerAnnotation;
}
/**
* @param string $customerAnnotation
* @return DeliveryAddress
*/
public function setCustomerAnnotation($customerAnnotation)
{
$this->customerAnnotation = $customerAnnotation;
return $this;
}
/**
* @return string
*/
public function getCustomerCommission()
{
return $this->customerCommission;
}
/**
* @param string $customerCommission
* @return DeliveryAddress
*/
public function setCustomerCommission($customerCommission)
{
$this->customerCommission = $customerCommission;
return $this;
}
/**
* @return string
*/
public function getCustomerEmail()
{
return $this->customerEmail;
}
/**
* @param string $customerEmail
* @return DeliveryAddress
*/
public function setCustomerEmail($customerEmail)
{
$this->customerEmail = $customerEmail;
return $this;
}
public function hasAllSearchStringParts(): bool
{
return !empty($this->getStreet()) &&
!empty($this->getStreetNo()) &&
!empty($this->getZip()) &&
!empty($this->getCity());
}
public function getSearchString()
{
$string = $this->getStreet(). ' '.
$this->getStreetNo().' '.
$this->getZip().' '.
$this->getCity().', ';
return str_replace(' ', '+', $string);
}
}