src/Entity/UserInformation.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserInformationRepository;
  4. use App\String\Constant;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassUserInformationRepository::class)]
  8. class UserInformation
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255nullabletrue)]
  15.     private $website;
  16.     #[ORM\Column(type'string'length255nullabletrue)]
  17.     private $facebook;
  18.     #[ORM\Column(type'string'length255nullabletrue)]
  19.     private $twitter;
  20.     #[ORM\OneToOne(inversedBy'userInformation'targetEntityUser::class, cascade: ['persist''remove'])]
  21.     private $user;
  22.     #[ORM\Column(type'string'length255nullabletrue)]
  23.     private $xeroId;
  24.     #[ORM\Column(type'string'length255nullabletrue)]
  25.     private $salesforceId;
  26.     #[ORM\Column(type'integer'nullabletrue)]
  27.     private $wordpressId;
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getWebsite(): ?string
  33.     {
  34.         return $this->website;
  35.     }
  36.     public function setWebsite(?string $website): self
  37.     {
  38.         $this->website $website;
  39.         return $this;
  40.     }
  41.     public function getFacebook(): ?string
  42.     {
  43.         return $this->facebook;
  44.     }
  45.     public function setFacebook(?string $facebook): self
  46.     {
  47.         $this->facebook $facebook;
  48.         return $this;
  49.     }
  50.     public function getTwitter(): ?string
  51.     {
  52.         return $this->twitter;
  53.     }
  54.     public function setTwitter(?string $twitter): self
  55.     {
  56.         $this->twitter $twitter;
  57.         return $this;
  58.     }
  59.     public function getUser(): ?User
  60.     {
  61.         return $this->user;
  62.     }
  63.     public function setUser(?User $user): self
  64.     {
  65.         $this->user $user;
  66.         return $this;
  67.     }
  68.     public function getXeroId(): ?string
  69.     {
  70.         return $this->xeroId;
  71.     }
  72.     public function setXeroId(?string $xeroId): self
  73.     {
  74.         $this->xeroId $xeroId;
  75.         return $this;
  76.     }
  77.     public function getSalesforceId(): ?string
  78.     {
  79.         return $this->salesforceId;
  80.     }
  81.     public function setSalesforceId(?string $salesforceId): self
  82.     {
  83.         $this->salesforceId $salesforceId;
  84.         return $this;
  85.     }
  86.     public function getWordpressId(): ?int
  87.     {
  88.         return $this->wordpressId;
  89.     }
  90.     public function setWordpressId(?int $wordpressId): self
  91.     {
  92.         $this->wordpressId $wordpressId;
  93.         return $this;
  94.     }
  95.     public function getIntegrationUrl(string $type): string
  96.     {
  97.         $url '';
  98.         switch($type) {
  99.             case 'salesforce'
  100.                 $url Constant::SALESFORCE_URL '/lightning/r/Contact/'$this->salesforceId .'/view';
  101.                 break;
  102.             case 'wordpress'
  103.                 $url Constant::WORDPRESS_URL '/author';
  104.                 break;    
  105.         }
  106.         return $url;
  107.     }
  108. }