<?php
namespace App\Entity;
use App\Repository\CommentRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CommentRepository::class)
*/
class Comment
{
const RESOURCE_KEY = 'comments';
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="text")
*/
private $text;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="comments")
* @ORM\JoinColumn(nullable=false)
*/
private $publisher;
/**
* @ORM\ManyToOne(targetEntity=Journal::class, inversedBy="comments")
* @ORM\JoinColumn(nullable=false)
*/
private $journal;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\Column(type="datetime",nullable=true)
*/
private $deleted_at;
public function getId(): ?int
{
return $this->id;
}
public function getText(): ?string
{
return $this->text;
}
public function setText(string $text): self
{
$this->text = $text;
return $this;
}
public function getPublisher(): ?User
{
return $this->publisher;
}
public function setPublisher(?User $publisher): self
{
$this->publisher = $publisher;
return $this;
}
public function getJournal(): ?Journal
{
return $this->journal;
}
public function setJournal(?Journal $journal): self
{
$this->journal = $journal;
return $this;
}
public function getCreatedAt(): ?\DateTime
{
return $this->created_at;
}
public function setCreatedAt(\DateTime $created_at): self
{
$this->created_at = $created_at;
return $this;
}
/**
* @return mixed
*/
public function getDeletedAt(): ?\DateTime
{
return $this->deleted_at;
}
/**
* @param mixed $deleted_at
*/
public function setDeletedAt(\DateTime $deleted_at): self
{
$this->deleted_at = $deleted_at;
return $this;
}
}