<?php
namespace App\Entity;
use App\Repository\WebsocketMessageRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\MaxDepth;
/**
* @ORM\Entity(repositoryClass=WebsocketMessageRepository::class)
*/
class WebsocketMessage
{
use \App\Traits\Enableable;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="websocketMessages")
* @ORM\JoinColumn(nullable=false)
* @MaxDepth(1)
*/
private $user;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $message;
/**
* @ORM\Column(type="datetime")
*/
private $date;
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(?string $message): self
{
$this->message = $message;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
}