src/Entity/UserGallery.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserGalleryRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassUserGalleryRepository::class)]
  6. class UserGallery
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column]
  11.     private ?int $id null;
  12.     #[ORM\ManyToOne(targetEntityGallery::class)]
  13.     protected ?Gallery $gallery null;
  14.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'userGallery')]
  15.     protected ?User $user null;
  16.     public function getId(): ?int
  17.     {
  18.         return $this->id;
  19.     }
  20.     public function getGallery(): ?Gallery
  21.     {
  22.         return $this->gallery;
  23.     }
  24.     public function setGallery(?Gallery $gallery): static
  25.     {
  26.         $this->gallery $gallery;
  27.         return $this;
  28.     }
  29.     public function getUser(): ?User
  30.     {
  31.         return $this->user;
  32.     }
  33.     public function setUser(?User $user): static
  34.     {
  35.         $this->user $user;
  36.         return $this;
  37.     }
  38. }