src/Entity/UserProfile.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserProfileRepository;
  4. use App\String\Constant;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassUserProfileRepository::class)]
  8. class UserProfile
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\OneToOne(inversedBy'userProfile'targetEntityUser::class, cascade: ['persist''remove'])]
  15.     private $user;
  16.     #[ORM\Column(type'text'nullabletrue)]
  17.     private $description;
  18.     #[ORM\Column(type'text'nullabletrue)]
  19.     private $shortDescription;
  20.     #[ORM\Column(type'text'nullabletrue)]
  21.     private $longDescription;
  22.     #[ORM\Column(type'string'length255nullabletrue)]
  23.     private $profilePicture;
  24.     #[ORM\Column(typeTypes::ARRAY, nullabletrue)]
  25.     private array $userRoles = [];
  26.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  27.     private ?string $reasonSupportDocumentary null;
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getUser(): ?User
  33.     {
  34.         return $this->user;
  35.     }
  36.     public function setUser(?User $user): self
  37.     {
  38.         $this->user $user;
  39.         return $this;
  40.     }
  41.     public function getDescription(): ?string
  42.     {
  43.         return $this->description;
  44.     }
  45.     public function setDescription(?string $description): self
  46.     {
  47.         $this->description $description;
  48.         return $this;
  49.     }
  50.     public function getShortDescription(): ?string
  51.     {
  52.         return $this->shortDescription;
  53.     }
  54.     public function setShortDescription(?string $shortDescription): self
  55.     {
  56.         $this->shortDescription $shortDescription;
  57.         return $this;
  58.     }
  59.     public function getLongDescription(): ?string
  60.     {
  61.         return $this->longDescription;
  62.     }
  63.     public function setLongDescription(?string $longDescription): self
  64.     {
  65.         $this->longDescription $longDescription;
  66.         return $this;
  67.     }
  68.     public function getProfilePicture(): ?string
  69.     {
  70.         return $this->profilePicture;
  71.     }
  72.     public function setProfilePicture(?string $profilePicture): self
  73.     {
  74.         $this->profilePicture $profilePicture;
  75.         return $this;
  76.     }
  77.     public function getProfilePictureUrl(): ?string
  78.     {
  79.         $url '';
  80.         if ($this->profilePicture) {
  81.             $url Constant::LOCALHOST_URL '/uploads/profiles/' $this->profilePicture;
  82.         }
  83.         return $url;
  84.     }
  85.     public function getUserRoles(): array
  86.     {
  87.         return $this->userRoles;
  88.     }
  89.     public function setUserRoles(?array $userRoles): self
  90.     {
  91.         $this->userRoles $userRoles;
  92.         return $this;
  93.     }
  94.     public function getReasonSupportDocumentary(): ?string
  95.     {
  96.         return $this->reasonSupportDocumentary;
  97.     }
  98.     public function setReasonSupportDocumentary(?string $reasonSupportDocumentary): self
  99.     {
  100.         $this->reasonSupportDocumentary $reasonSupportDocumentary;
  101.         return $this;
  102.     }
  103. }