<?phpnamespace App\Entity\ReseauSociaux;use App\Entity\ReseauSociaux\Espace;use App\Repository\ReseauSociaux\InvitationEspaceRepository;use Doctrine\ORM\Mapping as ORM;Use App\Entity\User;Use App\Entity\Company;use Symfony\Component\Serializer\Annotation\Groups;/** * @ORM\Entity(repositoryClass=InvitationEspaceRepository::class) */class InvitationEspace{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") * @Groups({"invitation:read", "notif:read"}) */ private $id; /** * @ORM\ManyToOne(targetEntity=Espace::class, inversedBy="invitationEspaces") * @ORM\JoinColumn(nullable=false) * @Groups({"invitation:read", "notif:read"}) */ private $espace; /** * @ORM\ManyToOne(targetEntity=User::class, inversedBy="invitationEspaces") * @Groups({"invitation:read"}) */ private $user; /** * @ORM\ManyToOne(targetEntity=Company::class, inversedBy="invitationEspaces") * @Groups({"invitation:read"}) */ private $company; /** * @ORM\Column(type="boolean", nullable=true) * @Groups({"invitation:read"}) */ private $isAccepted; /** * @ORM\Column(type="datetime_immutable") * @Groups({"invitation:read"}) */ private $createdAt; /** * @ORM\OneToOne(targetEntity=Notifications::class, mappedBy="invitationEspace", cascade={"persist", "remove"}) */ private $notifications; public function __construct() { $this->createdAt = new \DateTimeImmutable(); } public function getId(): ?int { return $this->id; } public function getEspace(): ?Espace { return $this->espace; } public function setEspace(?Espace $espace): self { $this->espace = $espace; return $this; } public function getUser(): ?User { return $this->user; } public function setUser(?User $user): self { $this->user = $user; return $this; } public function getCompany(): ?Company { return $this->company; } public function setCompany(?Company $company): self { $this->company = $company; return $this; } public function isIsAccepted(): ?bool { return $this->isAccepted; } public function setIsAccepted(?bool $isAccepted): self { $this->isAccepted = $isAccepted; return $this; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->createdAt; } public function setCreatedAt(\DateTimeImmutable $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getNotifications(): ?Notifications { return $this->notifications; } public function setNotifications(?Notifications $notifications): self { // unset the owning side of the relation if necessary if ($notifications === null && $this->notifications !== null) { $this->notifications->setInvitationEspace(null); } // set the owning side of the relation if necessary if ($notifications !== null && $notifications->getInvitationEspace() !== $this) { $notifications->setInvitationEspace($this); } $this->notifications = $notifications; return $this; }}