<?php
namespace App\Entity;
use App\Repository\OrderAddressRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=OrderAddressRepository::class)
* @ORM\EntityListeners({"App\Listener\EntityListener"})
*/
class OrderAddress
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
protected $firstName;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
protected $lastName;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
protected $email;
/**
* @ORM\Column(type="string", length=190, nullable=true)
*/
protected $phone;
/**
* @ORM\Column(type="string", length=150, nullable=true)
*/
private $companyName;
/**
* @ORM\Column(type="string", length=10, nullable=true)
*/
private $ico;
/**
* @ORM\Column(type="string", length=12, nullable=true)
*/
private $dic;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $street;
/**
* @ORM\Column(type="string", length=40, nullable=true)
*/
private $streetNumber;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $city;
/**
* @ORM\Column(type="string", length=40, nullable=true)
*/
private $country;
/**
* @ORM\Column(type="string", length=10, nullable=true)
*/
private $zip;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $note;
/**
* @ORM\Column(type="datetime")
*/
protected $createts;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $editts;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User")
*/
protected $editUser;
/**
* @ORM\Column(type="boolean")
*/
private $isCompany = false;
public function getId(): ?int
{
return $this->id;
}
public function init(?ClientAddress $address): self
{
if($address instanceof ClientAddress) {
$this->setLastName( $address->getLastName() );
$this->setFirstName( $address->getFirstName() );
$this->setCity( $address->getCity() );
$this->setCompanyName( $address->getCompanyName() );
$this->setIsCompany( $address->getisCompany() );
$this->setCountry( $address->getCountry() );
$this->setDic( $address->getDic() );
$this->setIco( $address->getIco() );
$this->setNote( $address->getNote() );
$this->setStreet( $address->getStreet() );
$this->setStreetNumber( $address->getStreetNumber() );
$this->setZip( $address->getZip() );
}
return $this;
}
public function getCompanyName(): ?string
{
return $this->companyName;
}
public function setCompanyName(?string $companyName): self
{
$this->companyName = $companyName;
return $this;
}
public function getIco(): ?string
{
return $this->ico;
}
public function setIco(?string $ico): self
{
$this->ico = $ico;
return $this;
}
public function getDic(): ?string
{
return $this->dic;
}
public function setDic(?string $dic): self
{
$this->dic = $dic;
return $this;
}
public function getStreet(): ?string
{
return $this->street;
}
public function setStreet(?string $street): self
{
$this->street = $street;
return $this;
}
public function getStreetNumber(): ?string
{
return $this->streetNumber;
}
public function setStreetNumber(?string $streetNumber): self
{
$this->streetNumber = $streetNumber;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): self
{
$this->city = $city;
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(?string $country): self
{
$this->country = $country;
return $this;
}
public function getZip(): ?string
{
return $this->zip;
}
public function setZip(?string $zip): self
{
$this->zip = $zip;
return $this;
}
public function getCreatets(): ?\DateTimeInterface
{
return $this->createts;
}
public function setCreatets(\DateTimeInterface $createts): self
{
$this->createts = $createts;
return $this;
}
public function getEditts(): ?\DateTimeInterface
{
return $this->editts;
}
public function setEditts(?\DateTimeInterface $editts): self
{
$this->editts = $editts;
return $this;
}
public function getEditUser(): ?User
{
return $this->editUser;
}
public function setEditUser(?User $editUser): self
{
$this->editUser = $editUser;
return $this;
}
/**
* Get Note
*
* @return mixed
*/
public function getNote()
{
return $this->note;
}
/**
* Set Note
*
* @param mixed $note
*/
public function setNote( $note )
{
$this->note = $note;
}
public function getFullName( )
{
return sprintf('%s %s',$this->getLastName(),$this->getFirstName());
}
public function getFirstName(): ?string
{
return $this->firstName;
}
public function setFirstName(?string $firstName): self
{
$this->firstName = $firstName;
return $this;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(?string $lastName): self
{
$this->lastName = $lastName;
return $this;
}
/**
* Get Phone
*
* @return mixed
*/
public function getPhone()
{
return $this->phone;
}
/**
* Set Phone
*
* @param mixed $phone
*/
public function setPhone( $phone )
{
$this->phone = $phone;
}
public function formatReport( )
{
return sprintf('%s %s, %s %s',$this->getStreet(),$this->getStreetNumber(),$this->getZip(),$this->getCity());
}
/**
* Get isCompany
*
* @return mixed
*/
public function getisCompany()
{
return $this->isCompany;
}
/**
* Set IsCompany
*
* @param mixed $isCompany
*/
public function setIsCompany( $isCompany )
{
$this->isCompany = $isCompany;
}
/**
* Get Email
*
* @return mixed
*/
public function getEmail()
{
return $this->email;
}
/**
* Set Email
*
* @param mixed $email
*/
public function setEmail( $email )
{
$this->email = $email;
}
}