src/Entity/Notification.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\NotificationRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=NotificationRepository::class)
  8.  */
  9. class Notification
  10. {
  11.     const DEFAULT_ICON "icon-feather-bell";
  12.     const TYPE_POST_FAVORY "post_favory";
  13.     const TYPE_POST_COMMENT "post_comment";
  14.     const TYPE_POST_REPLY "post_reply";
  15.     const TYPE_POST_OWNER "post_owner";
  16.     const TYPE_MISSION_ALERT "mission_alert";
  17.     const TYPE_MISSION_APPLY "mission_apply";
  18.     /**
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue
  21.      * @ORM\Column(type="integer")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\Column(type="string", length=25)
  26.      */
  27.     private ?string $type;
  28.     /**
  29.      * @ORM\Column(type="string", length=255, nullable=true)
  30.      */
  31.     private ?string $rubriqueID;
  32.     /**
  33.      * @ORM\Column(type="text")
  34.      */
  35.     private ?string $content;
  36.     /**
  37.      * @ORM\Column(type="boolean", nullable=true)
  38.      */
  39.     private ?bool $seen;
  40.     /**
  41.      * @ORM\Column(type="datetime")
  42.      */
  43.     private ?\DateTimeInterface $createdAt;
  44.     /**
  45.      * @ORM\Column(type="string", length=50, nullable=true)
  46.      */
  47.     private ?string $icon;
  48.     /**
  49.      * @ORM\ManyToOne(targetEntity=User::class)
  50.      */
  51.     private ?User $user;
  52.     /**
  53.      * @ORM\Column(type="datetime")
  54.      */
  55.     private ?\DateTimeInterface $updatedAt;
  56.     public function __construct()
  57.     {
  58.         $this->createdAt = new \DateTime();
  59.         $this->updatedAt = new \DateTime();
  60.         $this->icon self::DEFAULT_ICON;
  61.         $this->seen false;
  62.     }
  63.     public function getId(): ?int
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getType(): ?string
  68.     {
  69.         return $this->type;
  70.     }
  71.     public function setType(string $type): self
  72.     {
  73.         $this->type $type;
  74.         return $this;
  75.     }
  76.     public function getRubriqueID(): ?string
  77.     {
  78.         return $this->rubriqueID;
  79.     }
  80.     public function setRubriqueID(?string $rubriqueID): self
  81.     {
  82.         $this->rubriqueID $rubriqueID;
  83.         return $this;
  84.     }
  85.     public function getContent(): ?string
  86.     {
  87.         return $this->content;
  88.     }
  89.     public function setContent(string $content): self
  90.     {
  91.         $this->content $content;
  92.         return $this;
  93.     }
  94.     public function isSeen(): ?bool
  95.     {
  96.         return $this->seen;
  97.     }
  98.     public function setSeen(?bool $seen): self
  99.     {
  100.         $this->seen $seen;
  101.         return $this;
  102.     }
  103.     public function getCreatedAt(): ?\DateTimeInterface
  104.     {
  105.         return $this->createdAt;
  106.     }
  107.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  108.     {
  109.         $this->createdAt $createdAt;
  110.         return $this;
  111.     }
  112.     public function getIcon(): ?string
  113.     {
  114.         return $this->icon;
  115.     }
  116.     public function setIcon(?string $icon): self
  117.     {
  118.         $this->icon $icon;
  119.         return $this;
  120.     }
  121.     public function getUser(): ?User
  122.     {
  123.         return $this->user;
  124.     }
  125.     public function setUser(?User $user): self
  126.     {
  127.         $this->user $user;
  128.         return $this;
  129.     }
  130.     public function getUpdatedAt(): ?\DateTimeInterface
  131.     {
  132.         return $this->updatedAt;
  133.     }
  134.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  135.     {
  136.         $this->updatedAt $updatedAt;
  137.         return $this;
  138.     }
  139. }