<?phpnamespace App\Entity;use App\Repository\ForumNotificationSubscriberRepository;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=ForumNotificationSubscriberRepository::class) */class ForumNotificationSubscriber{ const TYPE_FAVORY = "favory"; const TYPE_COMMENT = "comment"; const TYPE_REPLY = "reply"; /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private int $id; /** * @ORM\ManyToOne(targetEntity=ForumPost::class, inversedBy="notificationSubscribers") */ private ?ForumPost $post; /** * @ORM\ManyToOne(targetEntity=ForumComment::class, inversedBy="notificationSubscribers") */ private ?ForumComment $comment; /** * @ORM\Column(type="string", length=25) */ private ?string $type; /** * @ORM\ManyToOne(targetEntity=ForumUser::class) */ private ?ForumUser $forumUser; // ------------------------------------------------------- public function setTypeFavory(){ $this->type = self::TYPE_FAVORY; } public function setTypeComment(){ $this->type = self::TYPE_COMMENT; } public function setTypeReply(){ $this->type = self::TYPE_REPLY; } //-------------------------------------------------------- public function getId(): ?int { return $this->id; } public function getPost(): ?ForumPost { return $this->post; } public function setPost(?ForumPost $post): self { $this->post = $post; return $this; } public function getComment(): ?ForumComment { return $this->comment; } public function setComment(?ForumComment $comment): self { $this->comment = $comment; return $this; } public function getType(): ?string { return $this->type; } public function setType(string $type): self { $this->type = $type; return $this; } public function getForumUser(): ?ForumUser { return $this->forumUser; } public function setForumUser(?ForumUser $forumUser): self { $this->forumUser = $forumUser; return $this; }}