src/Entity/Blog/Comment.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Blog;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\Blog\CommentRepository")
  9.  * @ORM\Table("blog_comment")
  10.  */
  11. class Comment
  12. {
  13.     /**
  14.      * @var int
  15.      *
  16.      * @ORM\Column(name="id", type="integer")
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity="Post", inversedBy="comments")
  23.      * @ORM\JoinColumn(name="post_id", referencedColumnName="id", onDelete="SET NULL")
  24.      */
  25.     private $post;
  26.     /**
  27.      * @ORM\Column(name="post_id", type="integer", nullable=true)
  28.      */
  29.     private $postId;
  30.     /**
  31.      * @var string
  32.      *
  33.      * @ORM\Column(name="name", type="string", length=255)
  34.      */
  35.     private $name;
  36.     /**
  37.      * @var string
  38.      * @Assert\Email(
  39.      *     message = "The email '{{ value }}' is not a valid email.",
  40.      *     checkMX = true,
  41.      *     checkHost = true,
  42.      *     strict = true
  43.      * )
  44.      * @ORM\Column(name="email", type="string", length=255)
  45.      */
  46.     private $email;
  47.     /**
  48.      * @var string
  49.      *
  50.      * @ORM\Column(name="message", type="text")
  51.      */
  52.     private $message;
  53.     /**
  54.      * @ORM\Column(name="approved", type="boolean", nullable=true)
  55.      */
  56.     private $approved false;
  57.     /**
  58.      * @var datetime
  59.      *
  60.      * @Gedmo\Timestampable(on="create")
  61.      * @ORM\Column(type="datetime")
  62.      */
  63.     private $created;
  64.     /**
  65.      * @var datetime
  66.      *
  67.      * @ORM\Column(type="datetime")
  68.      * @Gedmo\Timestampable(on="update")
  69.      */
  70.     private $updated;
  71.     /**
  72.      * @ORM\Column(name="enabled", type="boolean", nullable=true)
  73.      */
  74.     private $enabled false;
  75.     public function getId(): ?int
  76.     {
  77.         return $this->id;
  78.     }
  79.     public function getPostId(): ?int
  80.     {
  81.         return $this->postId;
  82.     }
  83.     public function setPostId(?int $postId): self
  84.     {
  85.         $this->postId $postId;
  86.         return $this;
  87.     }
  88.     public function getName(): ?string
  89.     {
  90.         return $this->name;
  91.     }
  92.     public function setName(string $name): self
  93.     {
  94.         $this->name $name;
  95.         return $this;
  96.     }
  97.     public function getEmail(): ?string
  98.     {
  99.         return $this->email;
  100.     }
  101.     public function setEmail(string $email): self
  102.     {
  103.         $this->email $email;
  104.         return $this;
  105.     }
  106.     public function getMessage(): ?string
  107.     {
  108.         return $this->message;
  109.     }
  110.     public function setMessage(string $message): self
  111.     {
  112.         $this->message $message;
  113.         return $this;
  114.     }
  115.     public function getApproved(): ?bool
  116.     {
  117.         return $this->approved;
  118.     }
  119.     public function setApproved(?bool $approved): self
  120.     {
  121.         $this->approved $approved;
  122.         return $this;
  123.     }
  124.     public function getCreated(): ?\DateTimeInterface
  125.     {
  126.         return $this->created;
  127.     }
  128.     public function setCreated(\DateTimeInterface $created): self
  129.     {
  130.         $this->created $created;
  131.         return $this;
  132.     }
  133.     public function getUpdated(): ?\DateTimeInterface
  134.     {
  135.         return $this->updated;
  136.     }
  137.     public function setUpdated(\DateTimeInterface $updated): self
  138.     {
  139.         $this->updated $updated;
  140.         return $this;
  141.     }
  142.     public function getEnabled(): ?bool
  143.     {
  144.         return $this->enabled;
  145.     }
  146.     public function setEnabled(?bool $enabled): self
  147.     {
  148.         $this->enabled $enabled;
  149.         return $this;
  150.     }
  151.     public function getPost(): ?Post
  152.     {
  153.         return $this->post;
  154.     }
  155.     public function setPost(?Post $post): self
  156.     {
  157.         $this->post $post;
  158.         return $this;
  159.     }
  160. }