<?php
namespace App\Entity;
use App\Repository\UserProfileRepository;
use App\String\Constant;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: UserProfileRepository::class)]
class UserProfile
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\OneToOne(inversedBy: 'userProfile', targetEntity: User::class, cascade: ['persist', 'remove'])]
private $user;
#[ORM\Column(type: 'text', nullable: true)]
private $description;
#[ORM\Column(type: 'text', nullable: true)]
private $shortDescription;
#[ORM\Column(type: 'text', nullable: true)]
private $longDescription;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $profilePicture;
#[ORM\Column(type: Types::ARRAY, nullable: true)]
private array $userRoles = [];
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $reasonSupportDocumentary = null;
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getShortDescription(): ?string
{
return $this->shortDescription;
}
public function setShortDescription(?string $shortDescription): self
{
$this->shortDescription = $shortDescription;
return $this;
}
public function getLongDescription(): ?string
{
return $this->longDescription;
}
public function setLongDescription(?string $longDescription): self
{
$this->longDescription = $longDescription;
return $this;
}
public function getProfilePicture(): ?string
{
return $this->profilePicture;
}
public function setProfilePicture(?string $profilePicture): self
{
$this->profilePicture = $profilePicture;
return $this;
}
public function getProfilePictureUrl(): ?string
{
$url = '';
if ($this->profilePicture) {
$url = Constant::LOCALHOST_URL . '/uploads/profiles/' . $this->profilePicture;
}
return $url;
}
public function getUserRoles(): array
{
return $this->userRoles;
}
public function setUserRoles(?array $userRoles): self
{
$this->userRoles = $userRoles;
return $this;
}
public function getReasonSupportDocumentary(): ?string
{
return $this->reasonSupportDocumentary;
}
public function setReasonSupportDocumentary(?string $reasonSupportDocumentary): self
{
$this->reasonSupportDocumentary = $reasonSupportDocumentary;
return $this;
}
}