src/Entity/Account/Avatar.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Account;
  3. use App\Entity\User;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. #[ORM\Table(name'user_media_files')]
  7. #[ORM\Entity]
  8. class Avatar
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\Column(name'id'type'integer')]
  12.     #[ORM\GeneratedValue(strategy'AUTO')]
  13.     protected int $id;
  14.     #[ORM\JoinColumn(name'user_id'referencedColumnName'id')]
  15.     #[ORM\OneToOne(targetEntityUser::class, inversedBy'avatar')]
  16.     protected User $user;
  17.     #[ORM\Column(name'path'type'string'length128)]
  18.     #[Groups(['comments'])]
  19.     protected string $path;
  20.     public function __construct(User $userstring $path)
  21.     {
  22.         $this->user $user;
  23.         $this->path $path;
  24.     }
  25.     public function getId(): int
  26.     {
  27.         return $this->id;
  28.     }
  29.     
  30.     public function getPath(): string
  31.     {
  32.         return $this->path;
  33.     }
  34. }