<?php
namespace App\Entity;
use App\Repository\CBRCArticleCommentRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CBRCArticleCommentRepository::class)
*/
class CBRCArticleComment
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=CBRCArticle::class, inversedBy="comments")
* @ORM\JoinColumn(nullable=false)
*/
private $article;
/**
* @ORM\ManyToOne(targetEntity=CBRCUser::class, inversedBy="comments")
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\Column(type="text")
*/
private $text;
/**
* @ORM\Column(type="boolean")
*/
private $isvisible;
/**
* @ORM\Column(type="datetime")
*/
private $creationdate;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedate;
public function __construct()
{
$this->setIsvisible(true);
$this->creationdate=new \Datetime('now');
}
public function getId(): ?int
{
return $this->id;
}
public function getArticle(): ?CBRCArticle
{
return $this->article;
}
public function setArticle(?CBRCArticle $article): self
{
$this->article = $article;
return $this;
}
public function getUser(): ?CBRCUser
{
return $this->user;
}
public function setUser(?CBRCUser $user): self
{
$this->user = $user;
return $this;
}
public function getText(): ?string
{
return $this->text;
}
public function setText(string $text): self
{
$this->text = $text;
return $this;
}
public function getIsvisible(): ?bool
{
return $this->isvisible;
}
public function setIsvisible(bool $isvisible): self
{
$this->isvisible = $isvisible;
return $this;
}
public function getCreationdate(): ?\DateTimeInterface
{
return $this->creationdate;
}
public function setCreationdate(\DateTimeInterface $creationdate): self
{
$this->creationdate = $creationdate;
return $this;
}
public function getUpdatedate(): ?\DateTimeInterface
{
return $this->updatedate;
}
public function setUpdatedate(?\DateTimeInterface $updatedate): self
{
$this->updatedate = $updatedate;
return $this;
}
public function getDisplaydate()
{
return $this->updatedate? : $this->creationdate;
}
}