<?php
namespace App\Entity\ThirdParty;
use App\Entity\User\Prefix;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Address
*
* @ORM\Table(name="addresses")
* @ORM\Entity(repositoryClass="App\Repository\ThirdParty\AddressRepository")
* @Gedmo\Loggable(logEntryClass="App\Entity\History\History")
*/
class Address
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\ThirdParty\ThirdParty", inversedBy="addresses")
* @ORM\JoinColumn(nullable=true)
*/
private $thirdParty;
/**
* @var string
*
* @ORM\Column(name="organisation", type="string", length=255, nullable=true)
*/
private $organisation;
/**
* @var int
*
* @ORM\ManyToOne(targetEntity="App\Entity\User\Prefix")
*/
private $prefix;
/**
* @var string
*
* @ORM\Column(name="firstname", type="string", length=255, nullable=true)
*/
private $firstname;
/**
* @var string
*
* @ORM\Column(name="lastname", type="string", length=255, nullable=true)
*/
private $lastname;
/**
* @var string
*
* @ORM\Column(name="complement", type="string", length=255, nullable=true)
*/
private $complement;
/**
* @var string
*
* @ORM\Column(name="address1", type="string", length=255)
* @Assert\NotBlank()
*/
private $address1;
/**
* @var string
*
* @ORM\Column(name="address2", type="string", length=255, nullable=true)
*/
private $address2;
/**
* @var int
*
* @ORM\Column(name="zipcode", type="integer")
* @Assert\NotBlank()
* @Assert\Type(type="numeric")
*/
private $zipcode;
/**
* @var string
*
* @ORM\Column(name="city", type="string", length=255)
* @Assert\NotBlank()
*/
private $city;
/**
* @var int
*
* @ORM\Column(name="country", type="string", length=255)
* @Assert\NotBlank()
*/
private $country = 'FR';
/**
* @ORM\Column(name="mobile_phone", type="string", length=255, nullable=true)
*/
private $mobilePhone;
/**
* @ORM\Column(name="phone", type="string", length=255, nullable=true)
*/
private $phone;
/**
* @var string
*
* @ORM\Column(name="email", type="string", length=255, nullable=true)
*/
private $email;
/**
* @var \DateTime
*
* @Gedmo\Timestampable(on="create")
* @ORM\Column(name="created_date", type="datetime", nullable=false)
*/
private $createdDate;
/**
* @var \DateTime
*
* @Gedmo\Timestampable(on="update")
* @ORM\Column(name="updated_date", type="datetime", nullable=true)
*/
private $updatedDate;
/**
* @var bool
*
* @ORM\Column(name="status", type="boolean")
*/
private $status = true;
public function __clone()
{
$this->id = null;
$this->setThirdParty(null);
$this->setCreatedDate(null);
$this->setUpdatedDate(null);
}
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set organisation
*
* @param string $organisation
*
* @return Address
*/
public function setOrganisation($organisation)
{
$this->organisation = $organisation;
return $this;
}
/**
* Get organisation
*
* @return string
*/
public function getOrganisation()
{
return $this->organisation;
}
/**
* Set prefix
*
* @param \App\Entity\User\Prefix $prefix
*
* @return \App\Entity\User\User
*/
public function setPrefix($prefix)
{
$this->prefix = $prefix;
return $this;
}
/**
* Get prefix
*
* @return \App\Entity\User\Prefix $prefix
*/
public function getPrefix()
{
return $this->prefix;
}
/**
* Set firstname
*
* @param string $firstname
*
* @return Address
*/
public function setFirstname($firstname)
{
$this->firstname = $firstname;
return $this;
}
/**
* Get firstname
*
* @return string
*/
public function getFirstname()
{
return $this->firstname;
}
/**
* Set lastname
*
* @param string $lastname
*
* @return Address
*/
public function setLastname($lastname)
{
$this->lastname = $lastname;
return $this;
}
/**
* Get lastname
*
* @return string
*/
public function getLastname()
{
return $this->lastname;
}
/**
* Set complement
*
* @param string $complement
*
* @return Address
*/
public function setComplement($complement)
{
$this->complement = $complement;
return $this;
}
/**
* Get complement
*
* @return string
*/
public function getComplement()
{
return $this->complement;
}
/**
* Set address1
*
* @param string $address1
*
* @return Address
*/
public function setAddress1($address1)
{
$this->address1 = $address1;
return $this;
}
/**
* Get address1
*
* @return string
*/
public function getAddress1()
{
return $this->address1;
}
/**
* Set address2
*
* @param string $address2
*
* @return Address
*/
public function setAddress2($address2)
{
$this->address2 = $address2;
return $this;
}
/**
* Get address2
*
* @return string
*/
public function getAddress2()
{
return $this->address2;
}
/**
* Set zipcode
*
* @param integer $zipcode
*
* @return Address
*/
public function setZipcode($zipcode)
{
$this->zipcode = $zipcode;
return $this;
}
/**
* Get zipcode
*
* @return int
*/
public function getZipcode()
{
return $this->zipcode;
}
/**
* Set city
*
* @param string $city
*
* @return Address
*/
public function setCity($city)
{
$this->city = $city;
return $this;
}
/**
* Get city
*
* @return string
*/
public function getCity()
{
return $this->city;
}
/**
* Set country
*
* @param string $country
*
* @return Address
*/
public function setCountry($country)
{
$this->country = $country;
return $this;
}
/**
* Get country
*
* @return string
*/
public function getCountry()
{
return $this->country;
}
/**
* Set mobilePhone
*
* @param string $mobilePhone
*
* @return Address
*/
public function setMobilePhone($mobilePhone)
{
$this->mobilePhone = $mobilePhone;
return $this;
}
/**
* Get mobilePhone
*
* @return libphonenumber\PhoneNumber
*/
public function getMobilePhone()
{
return $this->mobilePhone;
}
/**
* Set phone
*
* @param string $phone
*
* @return Address
*/
public function setPhone($phone)
{
$this->phone = $phone;
return $this;
}
/**
* Get phone
*
* @return libphonenumber\PhoneNumber
*/
public function getPhone()
{
return $this->phone;
}
/**
* Set email
*
* @param string $email
*
* @return Address
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
/**
* Get email
*
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* Get createdDate
*
* @return \DateTime
*/
public function getCreatedDate()
{
return $this->createdDate;
}
/**
* Get updatedDate
*
* @return \DateTime
*/
public function getUpdatedDate()
{
return $this->updatedDate;
}
/**
* Set status
*
* @param boolean $status
*
* @return \App\Entity\ThirdParty\Address
*/
public function setStatus($status)
{
$this->status = $status;
return $this;
}
/**
* Get status
*
* @return boolean
*/
public function getStatus()
{
return $this->status;
}
/**
* Set thirdParty
*
* @param \App\Entity\ThirdParty\ThirdParty $thirdParty
*
* @return Address
*/
public function setThirdParty(\App\Entity\ThirdParty\ThirdParty $thirdParty = null)
{
$this->thirdParty = $thirdParty;
return $this;
}
/**
* Get thirdParty
*
* @return \App\Entity\ThirdParty\ThirdParty
*/
public function getThirdParty()
{
return $this->thirdParty;
}
}