src/Entity/UserGallery.php line 10

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