feat(user-profile): add avatar upload functionality and update UserProfile entity

This commit is contained in:
hamed
2026-06-19 10:19:47 +03:30
parent 9b0af282e0
commit a8d36d7455
7 changed files with 127 additions and 1 deletions
+6
View File
@@ -84,6 +84,9 @@ class UserProfile
#[ORM\Column(type: 'text', nullable: true)]
private ?string $description = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $avatar = null;
#[ORM\Column(name: 'created_at', type: 'integer')]
private int $createdAt;
@@ -122,6 +125,7 @@ class UserProfile
public function getOther(): ?array { return $this->other; }
public function isSharingWithUser(): bool { return $this->sharingWithUser; }
public function getDescription(): ?string { return $this->description; }
public function getAvatar(): ?string { return $this->avatar; }
public function getCreatedAt(): int { return $this->createdAt; }
public function getUpdatedAt(): int { return $this->updatedAt; }
@@ -145,6 +149,7 @@ class UserProfile
public function setOther(?array $v): self { $this->other = $v; $this->touch(); return $this; }
public function setSharingWithUser(bool $v): self { $this->sharingWithUser = $v; $this->touch(); return $this; }
public function setDescription(?string $v): self { $this->description = $v; $this->touch(); return $this; }
public function setAvatar(?string $v): self { $this->avatar = $v; $this->touch(); return $this; }
private function touch(): void { $this->updatedAt = time(); }
@@ -174,6 +179,7 @@ class UserProfile
'other' => $this->other,
'sharing_with_user' => $this->sharingWithUser,
'description' => $this->description,
'avatar' => $this->avatar,
'created_at' => $this->createdAt,
'updated_at' => $this->updatedAt,
];