<?php
declare(strict_types=1);
namespace App\Entity;
use App\Repository\UsersEstablishmentsRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
use Symfony\Component\Uid\Uuid;
/**
* @ORM\Entity(repositoryClass=UsersEstablishmentsRepository::class)
*/
class UsersEstablishments
{
/**
* @ORM\Id
* @ORM\Column(type="uuid")
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class=UuidGenerator::class)
*/
private ?Uuid $id = null;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="usersEstablishments")
* @ORM\JoinColumn(nullable=false)
*/
private ?User $user;
/**
* @ORM\ManyToOne(targetEntity=Establishment::class, inversedBy="usersEstablishments")
* @ORM\JoinColumn(nullable=false)
*/
private ?Establishment $establishment;
public function getId(): ?Uuid
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getEstablishment(): ?Establishment
{
return $this->establishment;
}
public function setEstablishment(?Establishment $establishment): self
{
$this->establishment = $establishment;
return $this;
}
}