<?php
namespace App\Entity;
use App\Repository\DiscutionRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=DiscutionRepository::class)
*/
class Discution
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\Column(type="text")
*/
private $message;
/**
* @ORM\ManyToOne(targetEntity=Reclamation::class, inversedBy="discutions")
*/
private $reclamation;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="discutions")
*/
private $user;
public function __construct(){
$this->created_at = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function __toString()
{
return $this->getMessage();
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(string $message): self
{
$this->message = $message;
return $this;
}
public function getReclamation(): ?Reclamation
{
return $this->reclamation;
}
public function setReclamation(?Reclamation $reclamation): self
{
$this->reclamation = $reclamation;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
}