<?php
namespace App\Entity\Slave;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="eposm_s_user_profile")
* @ORM\Entity
*/
class UserProfile
{
public function __toString()
{
return $this->name." ".$this->surname;
}
public function displayAddress()
{
$result = '';
if($this->address != null) $result.= $this->address;
if($this->civic != null) $result.= ' '.$this->civic;
if($this->zip != null) $result.= ', '.$this->zip;
return $result;
}
/**
* @ORM\Column(name="id", type="bigint")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(name="name", type="string", length=191)
*/
protected $name;
/**
* @ORM\Column(name="surname", type="string", length=191)
*/
protected $surname;
/**
* @ORM\Column(name="phone", type="string", nullable=true, length=191)
*/
protected $phone;
/**
* @ORM\Column(name="fiscal_code", type="string", nullable=true, length=191)
*/
protected $fiscalCode;
/**
* @ORM\Column(name="vat", type="string", nullable=true, length=191)
*/
protected $vat;
/**
* @ORM\Column(name="phone_personal", type="string", nullable=true, length=191)
*/
protected $phonePersonal;
/**
* @ORM\Column(name="email_personal", type="string", nullable=true, length=191)
*/
protected $emailPersonal;
/**
* @ORM\Column(name="address", type="string", nullable=true, length=191)
*/
protected $address;
/**
* @ORM\Column(name="civic", type="string", nullable=true, length=191)
*/
protected $civic;
/**
* @ORM\Column(name="zip", type="string", nullable=true, length=191)
*/
protected $zip;
/**
* @ORM\Column(name="id_city", type="bigint", nullable=true)
*/
protected $idCity;
// OneToOne
/**
* @ORM\OneToOne(targetEntity="App\Entity\Slave\User", inversedBy="profile")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
private $user;
//
public function getId(): ?string
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getSurname(): ?string
{
return $this->surname;
}
public function setSurname(string $surname): self
{
$this->surname = $surname;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getFiscalCode(): ?string
{
return $this->fiscalCode;
}
public function setFiscalCode(?string $fiscalCode): self
{
$this->fiscalCode = $fiscalCode;
return $this;
}
public function getVat(): ?string
{
return $this->vat;
}
public function setVat(?string $vat): self
{
$this->vat = $vat;
return $this;
}
public function getPhonePersonal(): ?string
{
return $this->phonePersonal;
}
public function setPhonePersonal(?string $phonePersonal): self
{
$this->phonePersonal = $phonePersonal;
return $this;
}
public function getEmailPersonal(): ?string
{
return $this->emailPersonal;
}
public function setEmailPersonal(?string $emailPersonal): self
{
$this->emailPersonal = $emailPersonal;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(?string $address): self
{
$this->address = $address;
return $this;
}
public function getCivic(): ?string
{
return $this->civic;
}
public function setCivic(?string $civic): self
{
$this->civic = $civic;
return $this;
}
public function getZip(): ?string
{
return $this->zip;
}
public function setZip(?string $zip): self
{
$this->zip = $zip;
return $this;
}
public function getIdCity(): ?string
{
return $this->idCity;
}
public function setIdCity(?string $idCity): self
{
$this->idCity = $idCity;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
}