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="string", length=128)
  22.      */
  23.     private $ipAddr;
  24.     /**
  25.      * @ORM\Column(type="text")
  26.      */
  27.     private $text;
  28.     /**
  29.      * @ORM\Column(type="datetime")
  30.      */
  31.     private $dateCreate;
  32.     /**
  33.      * @ORM\Column(type="integer")
  34.      */
  35.     private $rating;
  36.     public function __construct()
  37.     {
  38.         $this->dateCreate = new \DateTime();
  39.         $this->rating 0;
  40.     }
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getAuthor(): ?string
  46.     {
  47.         return $this->author;
  48.     }
  49.     public function setAuthor(string $author): self
  50.     {
  51.         $this->author $author;
  52.         return $this;
  53.     }
  54.     public function getIpAddr(): ?string
  55.     {
  56.         return $this->ipAddr;
  57.     }
  58.     public function setIpAddr(string $ipAddr): self
  59.     {
  60.         $this->ipAddr $ipAddr;
  61.         return $this;
  62.     }
  63.     public function getText(): ?string
  64.     {
  65.         return $this->text;
  66.     }
  67.     public function setText(string $text): self
  68.     {
  69.         $this->text $text;
  70.         return $this;
  71.     }
  72.     public function getDateCreate(): ?\DateTimeInterface
  73.     {
  74.         return $this->dateCreate;
  75.     }
  76.     public function setDateCreate(\DateTimeInterface $dateCreate): self
  77.     {
  78.         $this->dateCreate $dateCreate;
  79.         return $this;
  80.     }
  81.     public function getRating(): ?int
  82.     {
  83.         return $this->rating;
  84.     }
  85.     public function setRating(int $rating): self
  86.     {
  87.         $this->rating $rating;
  88.         return $this;
  89.     }
  90. }