src/Entity/Forum/PostReport.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Forum;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Traits\CreatedUpdatedTrait;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use JMS\Serializer\Annotation\Exclude;
  7. use JMS\Serializer\Annotation as JMS;
  8. /**
  9.  * @ORM\Table(name="v_forum_post_report")
  10.  * @ORM\Entity
  11.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
  12.  */
  13. class PostReport
  14. {
  15.     /**
  16.      * @ORM\Id()
  17.      * @ORM\GeneratedValue()
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity="App\Entity\Forum\Post")
  23.      * @Exclude
  24.      */
  25.     private $post;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity="App\Entity\Forum\PostReply")
  28.      * @Exclude
  29.      */
  30.     private $reply;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  33.      * @Exclude
  34.      */
  35.     private $user;
  36.     /**
  37.      * @ORM\Column(type="text", nullable=true)
  38.      */
  39.     private $message;
  40.     /**
  41.      * @ORM\Column(name="deleted_at", type="datetime", nullable=true)
  42.      */
  43.     private $deletedAt;
  44.     use CreatedUpdatedTrait;
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     /**
  50.      * @return mixed
  51.      */
  52.     public function getPost()
  53.     {
  54.         return $this->post;
  55.     }
  56.     /**
  57.      * @param mixed $post
  58.      */
  59.     public function setPost($post): void
  60.     {
  61.         $this->post $post;
  62.     }
  63.     /**
  64.      * @return mixed
  65.      */
  66.     public function getUser()
  67.     {
  68.         return $this->user;
  69.     }
  70.     /**
  71.      * @param mixed $user
  72.      */
  73.     public function setUser($user): void
  74.     {
  75.         $this->user $user;
  76.     }
  77.     /**
  78.      * @return mixed
  79.      */
  80.     public function getReply()
  81.     {
  82.         return $this->reply;
  83.     }
  84.     /**
  85.      * @param mixed $reply
  86.      */
  87.     public function setReply($reply): void
  88.     {
  89.         $this->reply $reply;
  90.     }
  91.     /**
  92.      * @return mixed
  93.      */
  94.     public function getMessage()
  95.     {
  96.         return $this->message;
  97.     }
  98.     /**
  99.      * @param mixed $message
  100.      */
  101.     public function setMessage($message): void
  102.     {
  103.         $this->message $message;
  104.     }
  105.     /**
  106.      * @JMS\VirtualProperty
  107.      * @JMS\SerializedName("user_id")
  108.      *
  109.      * @return string
  110.      */
  111.     public function getUserId()
  112.     {
  113.         return $this->getUser()->getId();
  114.     }
  115.     /**
  116.      * @JMS\VirtualProperty
  117.      * @JMS\SerializedName("user_name")
  118.      *
  119.      * @return string
  120.      */
  121.     public function getUserName()
  122.     {
  123.         return $this->getUser()->getName();
  124.     }
  125.     /**
  126.      * @return mixed
  127.      */
  128.     public function getDeletedAt()
  129.     {
  130.         return $this->deletedAt;
  131.     }
  132.     /**
  133.      * @param mixed $deletedAt
  134.      */
  135.     public function setDeletedAt($deletedAt): void
  136.     {
  137.         $this->deletedAt $deletedAt;
  138.     }
  139. }