src/Entity/UsersEstablishments.php line 15

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use App\Repository\UsersEstablishmentsRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
  7. use Symfony\Component\Uid\Uuid;
  8. /**
  9.  * @ORM\Entity(repositoryClass=UsersEstablishmentsRepository::class)
  10.  */
  11. class UsersEstablishments
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\Column(type="uuid")
  16.      * @ORM\GeneratedValue(strategy="CUSTOM")
  17.      * @ORM\CustomIdGenerator(class=UuidGenerator::class)
  18.      */
  19.     private ?Uuid $id null;
  20.     /**
  21.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="usersEstablishments")
  22.      * @ORM\JoinColumn(nullable=false)
  23.      */
  24.     private ?User $user;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity=Establishment::class, inversedBy="usersEstablishments")
  27.      * @ORM\JoinColumn(nullable=false)
  28.      */
  29.     private ?Establishment $establishment;
  30.     public function getId(): ?Uuid
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getUser(): ?User
  35.     {
  36.         return $this->user;
  37.     }
  38.     public function setUser(?User $user): self
  39.     {
  40.         $this->user $user;
  41.         return $this;
  42.     }
  43.     public function getEstablishment(): ?Establishment
  44.     {
  45.         return $this->establishment;
  46.     }
  47.     public function setEstablishment(?Establishment $establishment): self
  48.     {
  49.         $this->establishment $establishment;
  50.         return $this;
  51.     }
  52. }