src/Entity/Gos/Notification.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Table()
  6.  * @ORM\Entity(repositoryClass="App\Repository\Gos\NotificationRepository")
  7.  * @ORM\HasLifecycleCallbacks()
  8.  */
  9. class Notification
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255)
  19.      */
  20.     private $name;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=true)
  23.      */
  24.     private $url;
  25.     /**
  26.      * @ORM\Column(type="boolean", nullable=true)
  27.      */
  28.     private $isUnread;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\User", inversedBy="notifications")
  31.      * @ORM\JoinColumn()
  32.      */
  33.     private $user;
  34.     /**
  35.      * @ORM\Column(type="datetime")
  36.      */
  37.     private $createdAt;
  38.     /**
  39.      * @ORM\Column(type="datetime", nullable=true)
  40.      */
  41.     private $updatedAt;
  42.     /** @ORM\PrePersist() */
  43.     public function prePersist()
  44.     {
  45.         $this->createdAt = new \DateTime();
  46.     }
  47.     /** @ORM\PreUpdate() */
  48.     public function preUpdate()
  49.     {
  50.         $this->updatedAt = new \DateTime();
  51.     }
  52.     public function __construct()
  53.     {
  54.         $this->isUnread true;
  55.     }
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getName(): ?string
  61.     {
  62.         return $this->name;
  63.     }
  64.     public function setName(string $name): self
  65.     {
  66.         $this->name $name;
  67.         return $this;
  68.     }
  69.     public function getUrl(): ?string
  70.     {
  71.         return $this->url;
  72.     }
  73.     public function setUrl(?string $url): self
  74.     {
  75.         $this->url $url;
  76.         return $this;
  77.     }
  78.     public function getIsUnread(): ?bool
  79.     {
  80.         return $this->isUnread;
  81.     }
  82.     public function setIsUnread(?bool $isUnread): self
  83.     {
  84.         $this->isUnread $isUnread;
  85.         return $this;
  86.     }
  87.     public function getCreatedAt(): ?\DateTimeInterface
  88.     {
  89.         return $this->createdAt;
  90.     }
  91.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  92.     {
  93.         $this->createdAt $createdAt;
  94.         return $this;
  95.     }
  96.     public function getUpdatedAt(): ?\DateTimeInterface
  97.     {
  98.         return $this->updatedAt;
  99.     }
  100.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  101.     {
  102.         $this->updatedAt $updatedAt;
  103.         return $this;
  104.     }
  105.     public function getUser(): ?User
  106.     {
  107.         return $this->user;
  108.     }
  109.     public function setUser(?User $user): self
  110.     {
  111.         $this->user $user;
  112.         return $this;
  113.     }
  114. }