src/Entity/Comment.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CommentRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=CommentRepository::class)
  7.  */
  8. class Comment
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="string", length=255)
  18.      */
  19.     private $author;
  20.     /**
  21.      * @ORM\Column(type="text")
  22.      */
  23.     private $content;
  24.     /**
  25.      * @ORM\Column(type="datetime")
  26.      */
  27.     private $createdAt;
  28.     /**
  29.      * @ORM\ManyToOne(targetEntity=Article::class, inversedBy="comments")
  30.      * @ORM\JoinColumn(nullable=false)
  31.      */
  32.     private $article;
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getAuthor(): ?string
  38.     {
  39.         return $this->author;
  40.     }
  41.     public function setAuthor(string $author): self
  42.     {
  43.         $this->author $author;
  44.         return $this;
  45.     }
  46.     public function getContent(): ?string
  47.     {
  48.         return $this->content;
  49.     }
  50.     public function setContent(string $content): self
  51.     {
  52.         $this->content $content;
  53.         return $this;
  54.     }
  55.     public function getCreatedAt(): ?\DateTimeInterface
  56.     {
  57.         return $this->createdAt;
  58.     }
  59.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  60.     {
  61.         $this->createdAt $createdAt;
  62.         return $this;
  63.     }
  64.     public function getArticle(): ?Article
  65.     {
  66.         return $this->article;
  67.     }
  68.     public function setArticle(?Article $article): self
  69.     {
  70.         $this->article $article;
  71.         return $this;
  72.     }
  73. }