src/Entity/ForumNotificationSubscriber.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ForumNotificationSubscriberRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=ForumNotificationSubscriberRepository::class)
  7.  */
  8. class ForumNotificationSubscriber
  9. {
  10.     const TYPE_FAVORY "favory";
  11.     const TYPE_COMMENT "comment";
  12.     const TYPE_REPLY "reply";
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private int $id;
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity=ForumPost::class, inversedBy="notificationSubscribers")
  21.      */
  22.     private ?ForumPost $post;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=ForumComment::class, inversedBy="notificationSubscribers")
  25.      */
  26.     private ?ForumComment $comment;
  27.     /**
  28.      * @ORM\Column(type="string", length=25)
  29.      */
  30.     private ?string $type;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity=ForumUser::class)
  33.      */
  34.     private ?ForumUser $forumUser;
  35.     // -------------------------------------------------------
  36.     public function setTypeFavory(){
  37.         $this->type self::TYPE_FAVORY;
  38.     }
  39.     public function setTypeComment(){
  40.         $this->type self::TYPE_COMMENT;
  41.     }
  42.     public function setTypeReply(){
  43.         $this->type self::TYPE_REPLY;
  44.     }
  45.     //--------------------------------------------------------
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getPost(): ?ForumPost
  51.     {
  52.         return $this->post;
  53.     }
  54.     public function setPost(?ForumPost $post): self
  55.     {
  56.         $this->post $post;
  57.         return $this;
  58.     }
  59.     public function getComment(): ?ForumComment
  60.     {
  61.         return $this->comment;
  62.     }
  63.     public function setComment(?ForumComment $comment): self
  64.     {
  65.         $this->comment $comment;
  66.         return $this;
  67.     }
  68.     public function getType(): ?string
  69.     {
  70.         return $this->type;
  71.     }
  72.     public function setType(string $type): self
  73.     {
  74.         $this->type $type;
  75.         return $this;
  76.     }
  77.     public function getForumUser(): ?ForumUser
  78.     {
  79.         return $this->forumUser;
  80.     }
  81.     public function setForumUser(?ForumUser $forumUser): self
  82.     {
  83.         $this->forumUser $forumUser;
  84.         return $this;
  85.     }
  86. }