src/Entity/UserBlogComment.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Timestampable\Traits\TimestampableEntity;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\UserBlogCommentRepository")
  9.  */
  10. class UserBlogComment
  11. {
  12.     use TimestampableEntity;
  13.     /**
  14.      * @ORM\Id()
  15.      * @ORM\GeneratedValue()
  16.      * @ORM\Column(type="integer")
  17.      * @Groups({"BlogComment"})
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\ManyToOne(targetEntity="App\Entity\Blog", inversedBy="userComments")
  22.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  23.      */
  24.     private $blog;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  27.      * @ORM\JoinColumn(nullable=false)
  28.      * @Groups({"BlogComment"})
  29.      */
  30.     private $user;
  31.     /**
  32.      * @ORM\Column(type="text")
  33.      * @Assert\NotBlank()
  34.      * @Groups({"BlogComment"})
  35.      */
  36.     private $content;
  37.     /**
  38.      * @ORM\Column(type="boolean")
  39.      * @Assert\Type(type="boolean")
  40.      * @Groups({"BlogComment"})
  41.      */
  42.     private $isAnonymous;
  43.     /**
  44.      * @ORM\Column(type="boolean")
  45.      * @Assert\Type(type="boolean")
  46.      */
  47.     private $flagged;
  48.     /**
  49.      * @ORM\Column(type="boolean")
  50.      * @Assert\Type(type="boolean")
  51.      */
  52.     private $blocked;
  53.     public function __construct()
  54.     {
  55.         $this->isAnonymous true;
  56.         $this->flagged false;
  57.         $this->blocked false;
  58.     }
  59.     public function getId(): ?int
  60.     {
  61.         return $this->id;
  62.     }
  63.     public function getBlog(): ?Blog
  64.     {
  65.         return $this->blog;
  66.     }
  67.     public function setBlog(?Blog $blog): self
  68.     {
  69.         $this->blog $blog;
  70.         return $this;
  71.     }
  72.     public function getUser(): ?User
  73.     {
  74.         return $this->user;
  75.     }
  76.     public function setUser(?User $user): self
  77.     {
  78.         $this->user $user;
  79.         return $this;
  80.     }
  81.     public function getContent(): ?string
  82.     {
  83.         return $this->content;
  84.     }
  85.     public function setContent(?string $content): self
  86.     {
  87.         $this->content $content;
  88.         return $this;
  89.     }
  90.     public function getIsAnonymous(): ?bool
  91.     {
  92.         return $this->isAnonymous;
  93.     }
  94.     public function setIsAnonymous(bool $isAnonymous): self
  95.     {
  96.         $this->isAnonymous $isAnonymous;
  97.         return $this;
  98.     }
  99.     public function getFlagged(): ?bool
  100.     {
  101.         return $this->flagged;
  102.     }
  103.     public function setFlagged(bool $flagged): self
  104.     {
  105.         $this->flagged $flagged;
  106.         return $this;
  107.     }
  108.     public function getBlocked(): ?bool
  109.     {
  110.         return $this->blocked;
  111.     }
  112.     public function setBlocked(bool $blocked): self
  113.     {
  114.         $this->blocked $blocked;
  115.         return $this;
  116.     }
  117. }