src/Entity/CBRCArticleComment.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CBRCArticleCommentRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=CBRCArticleCommentRepository::class)
  7.  */
  8. class CBRCArticleComment
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\ManyToOne(targetEntity=CBRCArticle::class, inversedBy="comments")
  18.      * @ORM\JoinColumn(nullable=false)
  19.      */
  20.     private $article;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity=CBRCUser::class, inversedBy="comments")
  23.      * @ORM\JoinColumn(nullable=false)
  24.      */
  25.     private $user;
  26.     /**
  27.      * @ORM\Column(type="text")
  28.      */
  29.     private $text;
  30.     /**
  31.      * @ORM\Column(type="boolean")
  32.      */
  33.     private $isvisible;
  34.     /**
  35.      * @ORM\Column(type="datetime")
  36.      */
  37.     private $creationdate;
  38.     /**
  39.      * @ORM\Column(type="datetime", nullable=true)
  40.      */
  41.     private $updatedate;
  42.     public function __construct()
  43.     {
  44.         $this->setIsvisible(true);
  45.         $this->creationdate=new \Datetime('now');
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getArticle(): ?CBRCArticle
  52.     {
  53.         return $this->article;
  54.     }
  55.     public function setArticle(?CBRCArticle $article): self
  56.     {
  57.         $this->article $article;
  58.         return $this;
  59.     }
  60.     public function getUser(): ?CBRCUser
  61.     {
  62.         return $this->user;
  63.     }
  64.     public function setUser(?CBRCUser $user): self
  65.     {
  66.         $this->user $user;
  67.         return $this;
  68.     }
  69.     public function getText(): ?string
  70.     {
  71.         return $this->text;
  72.     }
  73.     public function setText(string $text): self
  74.     {
  75.         $this->text $text;
  76.         return $this;
  77.     }
  78.     public function getIsvisible(): ?bool
  79.     {
  80.         return $this->isvisible;
  81.     }
  82.     public function setIsvisible(bool $isvisible): self
  83.     {
  84.         $this->isvisible $isvisible;
  85.         return $this;
  86.     }
  87.     public function getCreationdate(): ?\DateTimeInterface
  88.     {
  89.         return $this->creationdate;
  90.     }
  91.     public function setCreationdate(\DateTimeInterface $creationdate): self
  92.     {
  93.         $this->creationdate $creationdate;
  94.         return $this;
  95.     }
  96.     public function getUpdatedate(): ?\DateTimeInterface
  97.     {
  98.         return $this->updatedate;
  99.     }
  100.     public function setUpdatedate(?\DateTimeInterface $updatedate): self
  101.     {
  102.         $this->updatedate $updatedate;
  103.         return $this;
  104.     }
  105.     public function getDisplaydate()
  106.     {
  107.         return $this->updatedate? : $this->creationdate;
  108.     }
  109. }