src/Entity/Slave/UserProfile.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Slave;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Table(name="eposm_s_user_profile")
  9.  * @ORM\Entity
  10.  */
  11. class UserProfile
  12. {
  13.     public function __toString()
  14.     {
  15.         return $this->name." ".$this->surname;
  16.     }
  17.     
  18.     public function displayAddress()
  19.                                                                                {
  20.                                                                                    $result '';
  21.                                                                                    if($this->address != null$result.= $this->address;
  22.                                                                                    if($this->civic != null$result.= ' '.$this->civic;
  23.                                                                                    if($this->zip != null$result.= ', '.$this->zip;
  24.                                                                                    return $result;
  25.                                                                                }
  26.     
  27.     /**
  28.      * @ORM\Column(name="id", type="bigint")
  29.      * @ORM\Id
  30.      * @ORM\GeneratedValue(strategy="AUTO")
  31.      */
  32.     protected $id;
  33.     /**
  34.      * @ORM\Column(name="name", type="string", length=191)
  35.      */
  36.     protected $name;
  37.     
  38.     /**
  39.      * @ORM\Column(name="surname", type="string", length=191)
  40.      */
  41.     protected $surname;
  42.     
  43.     /**
  44.      * @ORM\Column(name="phone", type="string", nullable=true, length=191)
  45.      */
  46.     protected $phone;
  47.     
  48.     /**
  49.      * @ORM\Column(name="fiscal_code", type="string", nullable=true, length=191)
  50.      */
  51.     protected $fiscalCode;
  52.     
  53.     /**
  54.      * @ORM\Column(name="vat", type="string", nullable=true, length=191)
  55.      */
  56.     protected $vat;
  57.     
  58.     /**
  59.      * @ORM\Column(name="phone_personal", type="string", nullable=true, length=191)
  60.      */
  61.     protected $phonePersonal;
  62.     
  63.     /**
  64.      * @ORM\Column(name="email_personal", type="string", nullable=true, length=191)
  65.      */
  66.     protected $emailPersonal;
  67.     
  68.     /**
  69.      * @ORM\Column(name="address", type="string", nullable=true, length=191)
  70.      */
  71.     protected $address;
  72.     
  73.     /**
  74.      * @ORM\Column(name="civic", type="string", nullable=true, length=191)
  75.      */
  76.     protected $civic;
  77.     
  78.     /**
  79.      * @ORM\Column(name="zip", type="string", nullable=true, length=191)
  80.      */
  81.     protected $zip;
  82.     
  83.     /**
  84.      * @ORM\Column(name="id_city", type="bigint", nullable=true)
  85.      */
  86.     protected $idCity;
  87.     // OneToOne
  88.         /**
  89.          * @ORM\OneToOne(targetEntity="App\Entity\Slave\User", inversedBy="profile")
  90.          * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  91.          */
  92.         private $user;
  93.         public function getId(): ?string
  94.         {
  95.             return $this->id;
  96.         }
  97.         public function getName(): ?string
  98.         {
  99.             return $this->name;
  100.         }
  101.         public function setName(string $name): static
  102.         {
  103.             $this->name $name;
  104.             return $this;
  105.         }
  106.         public function getSurname(): ?string
  107.         {
  108.             return $this->surname;
  109.         }
  110.         public function setSurname(string $surname): static
  111.         {
  112.             $this->surname $surname;
  113.             return $this;
  114.         }
  115.         public function getPhone(): ?string
  116.         {
  117.             return $this->phone;
  118.         }
  119.         public function setPhone(?string $phone): static
  120.         {
  121.             $this->phone $phone;
  122.             return $this;
  123.         }
  124.         public function getFiscalCode(): ?string
  125.         {
  126.             return $this->fiscalCode;
  127.         }
  128.         public function setFiscalCode(?string $fiscalCode): static
  129.         {
  130.             $this->fiscalCode $fiscalCode;
  131.             return $this;
  132.         }
  133.         public function getVat(): ?string
  134.         {
  135.             return $this->vat;
  136.         }
  137.         public function setVat(?string $vat): static
  138.         {
  139.             $this->vat $vat;
  140.             return $this;
  141.         }
  142.         public function getPhonePersonal(): ?string
  143.         {
  144.             return $this->phonePersonal;
  145.         }
  146.         public function setPhonePersonal(?string $phonePersonal): static
  147.         {
  148.             $this->phonePersonal $phonePersonal;
  149.             return $this;
  150.         }
  151.         public function getEmailPersonal(): ?string
  152.         {
  153.             return $this->emailPersonal;
  154.         }
  155.         public function setEmailPersonal(?string $emailPersonal): static
  156.         {
  157.             $this->emailPersonal $emailPersonal;
  158.             return $this;
  159.         }
  160.         public function getAddress(): ?string
  161.         {
  162.             return $this->address;
  163.         }
  164.         public function setAddress(?string $address): static
  165.         {
  166.             $this->address $address;
  167.             return $this;
  168.         }
  169.         public function getCivic(): ?string
  170.         {
  171.             return $this->civic;
  172.         }
  173.         public function setCivic(?string $civic): static
  174.         {
  175.             $this->civic $civic;
  176.             return $this;
  177.         }
  178.         public function getZip(): ?string
  179.         {
  180.             return $this->zip;
  181.         }
  182.         public function setZip(?string $zip): static
  183.         {
  184.             $this->zip $zip;
  185.             return $this;
  186.         }
  187.         public function getIdCity(): ?string
  188.         {
  189.             return $this->idCity;
  190.         }
  191.         public function setIdCity(?string $idCity): static
  192.         {
  193.             $this->idCity $idCity;
  194.             return $this;
  195.         }
  196.         public function getUser(): ?User
  197.         {
  198.             return $this->user;
  199.         }
  200.         public function setUser(?User $user): static
  201.         {
  202.             $this->user $user;
  203.             return $this;
  204.         }
  205. }